Black Friday Sale! Get up to $40 off GP Premium!Learn more

[Support request] Remove items from dashboard menu

Home Forums Support Remove items from dashboard menu

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #499420
    Kaleem

    Hello sir, seriously i must commend you for your wonderful supports.
    Please kindly help me with the following code:

    /*
    REMOVE DASHBOARD MENUS FOR ALL BUT ADMINISTRATOR
    */
    if ( ! current_user_can(‘manage_options’) ) {
    add_action( ‘admin_menu’, ‘notadmin_remove_menus’, 999 );
    }
    function notadmin_remove_menus() {
    remove_menu_page(‘tools.php’);
    remove_submenu_page( ‘themes.php’, ‘themes.php’ ); // hide the theme selection submenu
    remove_submenu_page( ‘themes.php’, ‘widgets.php’ ); // hide the widgets submenu
    remove_submenu_page( ‘themes.php’, ‘customize.php?return=%2Fwp-admin%2Fprofile.php’ ); // hide the customizer submenu
    remove_submenu_page( ‘themes.php’, ‘themes.php?page=generate-options’ ); //hide generatepress submenu
    }

    I used the above code to remove items from dashboard “Appearance sub menus” and it successfully removed them except “Customizer” and “Generatepress” . please any correction in the code?

    #499657
    Tom
    Lead Developer
    Lead Developer
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.