Skip to content

Instantly share code, notes, and snippets.

@voneff
Last active June 25, 2019 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voneff/d0a1bf5a77b3f45b7bdeaa52996fa623 to your computer and use it in GitHub Desktop.
Save voneff/d0a1bf5a77b3f45b7bdeaa52996fa623 to your computer and use it in GitHub Desktop.
WordPress Dashboard: moving top level menu items added by plugins to the 'Settings' menu (example: CoBlocks)
<?php
/* Add the code below to functions.php of your child theme or your custom functionality plugin – without the php tag above – and remove this line */
/* Moving the CoBlocks menu item under the 'Settings' menu */
/* @link: https://codex.wordpress.org/Function_Reference/remove_menu_page */
/* @link: https://gist.github.com/voneff/d0a1bf5a77b3f45b7bdeaa52996fa623 */
function voneff_move_coblocks_settings() {
/* removing CoBlocks top level menu item */
remove_menu_page('coblocks-getting-started');
/* adding menu item under Settings */
add_submenu_page( 'options-general.php', 'CoBlocks', 'CoBlocks', 'manage_options', 'coblocks-getting-started');
}
add_action( 'admin_init', 'voneff_move_coblocks_settings' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment