• Resolved cpaprotna

    (@cpaprotna)


    The calendar will not be displayed on our site unless a user is plugged in. I know exactly what line of code is causing the issue, but I’m not sure what to do to fix it. The site is also using Woo-Commerce and aMember. To get WooCommerce to work correctly, I needed to add the following filter

    add_filter('woocommerce_prevent_admin_access', 'check_admin_access');

    Which runs this funtion:

    function check_admin_access( $redirect_to ) {	
    	$user = wp_get_current_user();
    	$admin_roles = array('administrator', 'chapter_president', 'shop_manager', 'editor');
    	//$admin_roles = array('administrator', 'chapter_president', 'editor');
    	if( is_array( $user->roles )) {
    		foreach($admin_roles as $role) {
    			if (in_array( $role, $user->roles ) ) {				
    				return false;
    			}
    		}
    	}
    	return true;
    }

    Something in this function is causing your calendar to not display. The calendar will only display for users who have one of the four roles listed above.

Viewing 1 replies (of 1 total)
  • Sona

    (@support-web-dorado)

    @cpaprotna,

    Please note that we will not be able to check this out without further details. Please contact using the form. Thanks. Mention that you have been forwarded from WP forum. Thanks.

Viewing 1 replies (of 1 total)
  • The topic ‘Calendar Not visible unless logged in’ is closed to new replies.