Remove Theme menu link from Admin Panel

Question

I am trying to remove menu from the admin panel

my code works as it removes some pages but i can’t remove the following.
admin.php?page=ot-theme-options
admin.php?page=ot-settings
admin.php?page=yith_woocompare_panel

add_action('admin_menu', 'remove_admin_menu_links');
function remove_admin_menu_links(){
    $user = wp_get_current_user();
    if( $user && isset($user->user_email) && 'name@domain.com' == $user->user_email ) {
        remove_menu_page('tools.php');
        remove_menu_page('options-general.php');
        remove_menu_page('plugins.php');
        remove_menu_page('users.php');
        remove_menu_page( 'themes.php' );  
        remove_submenu_page( 'themes.php', 'widgets.php' ); 
        remove_menu_page( 'wpcf7' ); 
        remove_menu_page( 'ot-theme-options' ); // Doesn't work
        remove_menu_page( 'ot-settings' ); // Doesn't work 

      //echo '<pre>' . print_r( $GLOBALS[ 'menu' ], TRUE) . '</pre>';

    }
}
0
, , sevoug 8 months 0 Answers 115 views 0

Leave an answer