Monday, 23 September 2019

WordPress administrator user should not loggedin in WooCommerce my account page

Administrator user can only customise themes. I am wp_set_auth_cookie() for auto login and I don't need any other admin pages. When theme customise, administrator user details showing in my account page. Is it possible to restrict administrator login in woocommerce my account page?

add_action( 'wp_loaded', 'my_theme_customization' );

function my_theme_customization()
{
    global $pagenow;
    if ($pagenow !== 'customize.php' && is_admin()) {
        header('Location:' . site_url());
        exit;
    }
}

enter image description here



from WordPress administrator user should not loggedin in WooCommerce my account page

No comments:

Post a Comment