• Resolved goldenpipes.net

    (@goldenpipesnet)


    I simply just want to get the main admin menu that sits to the left of the screen as an associative array in php. I just need the href part and maybe the name of each menu item. Is there a built in function to do this?

    Thanks,
    Matt

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter goldenpipes.net

    (@goldenpipesnet)

    wp_get_nav_menu_items( ‘adminmenu’ ) doesn’t seem to work

    Thread Starter goldenpipes.net

    (@goldenpipesnet)

    Finally, what I was looking for was the global $menu array.

    Here is a function that will simply show the array and it’s content. Once you have the $menu array, you can get any menu item in the admin menu.

    function edit_admin_menus() {
    	global $menu;
    	print_r($menu);
    }
    add_action( 'admin_menu', 'edit_admin_menus' );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How can I get the main admin menu items with php in wordpress?’ is closed to new replies.