Changes between Initial Version and Version 2 of Ticket #32785
- Timestamp:
- 08/11/2015 08:29:31 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #32785 – Description
initial v2 1 1 An easy to understand example to remove a admin submenu item is : 2 3 {{{ 2 4 remove_submenu_page( 'plugins.php', 'plugin-install.php' ); 3 5 remove_submenu_page( 'plugins.php', 'plugin-editor.php' ); 6 7 }}} 4 8 5 9 Using the add_action admin init one can remove all submenu pages except: … … 9 13 I found the following code to remove these sections. 10 14 15 16 {{{ 11 17 //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 12 18 add_action( 'after_setup_theme','remove_header_background', 100 ); … … 15 21 remove_custom_image_header(); 16 22 } 23 }}} 17 24 25 26 {{{ 18 27 function remove_customize_page(){ 19 28 global $submenu; … … 21 30 } 22 31 add_action( 'admin_menu', 'remove_customize_page'); 32 }}} 33 23 34 24 35 25 36 Having to add extra code shows lack of consistency. Removing Customize, Header and Background should be just as simple as: 37 38 {{{ 26 39 remove_submenu_page( 'themes.php', 'customize.php' ); 27 40 remove_submenu_page( 'themes.php', 'customize-header.php' ); 28 remove_submenu_page( 'themes.php', 'custom-background.php' ); 41 remove_submenu_page( 'themes.php', 'custom-background.php' ); 42 }}}