Remove from sidebar
-
Hello, we want to limit which roles can see Product Feed Pro in the sidebar. There dont look to be any plugin specific capabilities so I’m trying to use this function to remove the page. It works for other WP pages but not Product Feed Pro. Please could you advise how we can remove this from the sidebar? (The user role needs manage_woocommerce for other purposes so I can’t take that off):
add_action('admin_menu', 'remove_by_caps_admin_menu', 71);
function remove_by_caps_admin_menu(){
? ? if (is_admin()) {
? ? ? ? if ( //theyre not an admin and they're not a shop manager and theyre not in sales
? ? ? ? ? ? !current_user_can( 'administrator' ) &&?
? ? ? ? ? ? !current_user_can( 'shop_manager' )
? ? ? ? ? ? ) { ? ? ? ? ? ? ? ?
? ? ? ? ? ? remove_menu_page( 'admin.php?page=woo-product-feed-pro' ); //remove pfp
? ? ? ? }
? ? }
}
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Remove from sidebar’ is closed to new replies.