function function
Remove WordPress backend top level menu.
function parameter
parameters | data type | Required or not | descriptive | default value |
---|---|---|---|---|
$menu_slug | string (computer science) | be | Menu Slug | not have |
Function Return Value
Returns the removed menu data if it succeeds, or false if it fails.
usage example
The function needs to be mounted on the admin_init hook to take effect. In the following example, we remove the wpcf7 menu.
add_action( 'admin_init', function () {
remove_menu_page( 'wpcf7' );
});
related function
remove_submenu_page Functions and remove_menu_page Similar, except that there is an extra parameter for the parent menu slug.