Skip to content

Instantly share code, notes, and snippets.

@Sstobo
Created November 10, 2017 17:59
Show Gist options
  • Save Sstobo/288ac5b82e27e1e3da5eb291ce52a7c4 to your computer and use it in GitHub Desktop.
Save Sstobo/288ac5b82e27e1e3da5eb291ce52a7c4 to your computer and use it in GitHub Desktop.
[WP remove menus from build version] #build #wp #menu
What if we wanted to remove the Editor links from the Appearance/Plugins sub-menus so no internal end user can mess with code from inside WP?
// Remove "Editor" links from sub-menus
function inhabitent_remove_submenus() {
remove_submenu_page( 'themes.php', 'theme-editor.php' );
remove_submenu_page( 'plugins.php', 'plugin-editor.php' );
}
add_action( 'admin_menu', 'inhabitent_remove_submenus', 110 );
The priority number is an optional integer value on a scale of 1 to 999 that determines the priority of order for functions tied to that specific hook.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment