Administrator user can only customize themes. I am using wp_set_auth_cookie()
for auto login and I don’t need any other admin pages.
When theme customize, 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;
}
}
2
Answers
I think you can achieve it something like
I am not using wordpress from last 2 years, so you may like to look into line 1005 of
woocommerce/includes/class-wc-form-handler.php
I understand you should not mess with administrator privileges. Instead, you can create new user type with access as you want, and assign it to respective users.
You can create new user type under Users –> Capabilities in WordPress admin page.
Hope this will help you.