Last active
June 25, 2019 16:28
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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