• Resolved user9876789

    (@user9876789)


    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)
  • Plugin Support Jeff Alvarez

    (@superlemon1998)

    Hi @user9876789 ,

    You can call this action hook to remove the field menu field entirely. If you want to further fine tune, look into our bootstrap-old.php file on our plugin

    remove_action('admin_menu','woosea_menu_addition');
    Thread Starter user9876789

    (@user9876789)

    Great thanks, that works!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove from sidebar’ is closed to new replies.