Skip to content

Instantly share code, notes, and snippets.

@voneff
Last active Jun 25, 2019
Embed
What would you like to do?
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