Make WordPress Core

Changes between Initial Version and Version 2 of Ticket #32785


Ignore:
Timestamp:
08/11/2015 08:29:31 AM (11 years ago)
Author:
ocean90
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32785 – Description

    initial v2  
    11An easy to understand example to remove a admin submenu item is :
     2
     3{{{
    24remove_submenu_page( 'plugins.php', 'plugin-install.php' );     
    35remove_submenu_page( 'plugins.php', 'plugin-editor.php' );                         
     6
     7}}}
    48
    59Using the add_action admin init one can remove all submenu pages except:
    … …  
    913I found the following code to remove these sections.
    1014
     15
     16{{{
    1117//Remove the custom options provided by the default twentyeleven theme. https://wordpress.org/support/topic/remove-header-and-background-option-pages-in-twenty-eleven-child-theme?replies=11
    1218add_action( 'after_setup_theme','remove_header_background', 100 );
    … …  
    1521        remove_custom_image_header();
    1622}
     23}}}
    1724
     25
     26{{{
    1827function remove_customize_page(){
    1928        global $submenu;
    … …  
    2130}
    2231add_action( 'admin_menu', 'remove_customize_page');
     32}}}
     33
    2334
    2435
    2536Having to add extra code shows lack of consistency. Removing Customize, Header and Background should be just as simple as:
     37
     38{{{
    2639remove_submenu_page( 'themes.php', 'customize.php' );                           
    2740remove_submenu_page( 'themes.php', 'customize-header.php' );                 
    28 remove_submenu_page( 'themes.php', 'custom-background.php' );   
     41remove_submenu_page( 'themes.php', 'custom-background.php' ); 
     42}}}