Skip to content

Instantly share code, notes, and snippets.

@caralgar
Created December 3, 2015 08:25
Show Gist options
  • Save caralgar/13f142526e91ff27ad5b to your computer and use it in GitHub Desktop.
Save caralgar/13f142526e91ff27ad5b to your computer and use it in GitHub Desktop.
How to add custom menu to dashboard (or remove)
<?php
/*
Reference @codex:
- Add menu: https://codex.wordpress.org/Function_Reference/add_menu_page
- Select icon: https://developer.wordpress.org/resource/dashicons/#menu
- Remove menu: https://codex.wordpress.org/Function_Reference/remove_menu_page
- Remove sub-menu: https://codex.wordpress.org/remove_submenu_page
*/
add_action( 'admin_menu', 'register_custom_menu' );
function register_custom_menu() {
//add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position );
add_menu_page( 'Menús', 'Menús', 'manage_options', 'nav-menus.php', '', 'dashicons-menu', 21 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment