Remove master slider admin menu item from wordpress

I need to remove the Master Slider menu item from the wordpress admin menu. I have already tried the below but with no luck.

function edit_admin_menus() {
  remove_menu_page('master-sliders');
}
add_action( 'admin_menu', 'edit_admin_menus' );   

Related posts

Leave a Reply

2 comments

  1. This should work for you. I tried it on my end and it works with no problems:

    function sb_remove_admin_menus(){
        if ( function_exists('masterslider') ) { ?>
            <style type="text/css">
            #toplevel_page_master-slider {
                display: none;
            }       
            </style>
       <?php }
    }
    add_action('admin_menu', 'sb_remove_admin_menus');
    
  2. See if that resolves.

        function sb_remove_admin_menus(){
        if ( current_user_can('editor') ) { ?>
            <style type="text/css">
            #toplevel_page_master-slider {
                display: none;
            }       
            </style>
       <?php }
    }
    add_action('admin_menu', 'sb_remove_admin_menus');