How to use a WordPress’ existing admin icon?

I use the add_menu_page function to add an new admin menu: add_menu_page( ‘Custom_menu’, ‘Custom_menu’, ‘edit_posts’, ‘custom_slug’, ”, ‘wordpress_existing_icon’, 5 ); How to use one of WordPress’ existing icons? For instance, if I would like to use the “Posts” WordPress icon, by what must I replace ‘wordpress_existing_icon’ in the code above ? I tried ‘edit’ and … Read more

How to remove duplicate link from add_menu_page

In the theme admin menu below, the “MyTheme Menu Label” is being duplicated twice on the sidebar menu, once for the main menu link and again for the first submenu link. How can I remove the 2nd instance of the link add_menu_page( “MyTheme”, “MyTheme Menu Label”, //THIS IS REPEATED TWICE IN THE MENU “edit_themes”, “functions.php”, … Read more

add_submenu_page not working

I have a built a plugin which creates a custom menu like this: add_menu_page( ‘Wholesale Pricing’, ‘Wholesale’, ‘manage_options’, ‘woo-wholesale’, ‘woo_wholesale_page_call’); I am now trying to add a subpage item underneath this. I have read the codex and came up with: add_submenu_page( ‘woo-wholesale’, ‘Registrations’, ‘Registrations’, ‘manage_options’, ‘woo-wholesale-registrations’, ‘wwpr_page_call’ ); I am guessing this is incorrect as … Read more

add_menu_page permissions – what am I doing wrong?

I am running a fresh install of WordPress 3.3.2 and the only plugin enabled is one I’m developing, but I can’t seem to get past a permissions issue in add_menu_page. With the exception of using anonymous functions instead of named functions, I’m following the documentation almost exactly. My plugin source: <?php /* Plugin Name: Some … Read more

Show Custom Taxonomy Inside Custom Menu

I have a custom menu using add_menu_page: add_menu_page(‘My menu’ , ‘Some text’, ‘read’, ‘nwcm’); Under it, I show a custom post type menu item; // Create the news custom post type register_post_type(‘nwcm_news’, array( ‘labels’ => array( ‘name’ => __(‘News for clients’, NWCM_TEXT_DOMAIN) , ‘singular_name’ => __(‘News’, NWCM_TEXT_DOMAIN) ) , ‘public’ => true, ‘has_archive’ => true, … Read more

add_menu_page() with different name for first submenu item

The add_menu_page documentation says to pass the menu title as the second parameter: add_menu_page(‘Page Title’, ‘Menu Title’, …); When adding more pages later via add_submenu_page, the main page becomes the first entry in the submenu: However, I want the first item in the list to have a different name (but still point to the same … Read more