WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#20182 closed defect (bug) (invalid)

add_menu_page does nothing in wp 3.4 alpha

Reported by: helgatheviking Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4
Component: General Keywords:
Focuses: Cc:

Description

add_menu_page does nothing in wp 3.4 alpha.. not sure how to tell which build i'm using but i updated the bleeding edge nightly on 5 march.

following code works just fine for me in 3.3. also globally declaring $menu and the print_r($menu); doesn't do anything either.

add_action('admin_menu', 'my_admin_menu');

function my_admin_menu(){  
	add_menu_page('custom menu title', 'custom menu', 'administrator', 'custompage', 'custom_menu_page', '', 6); 
}


function custom_menu_page(){
   echo "Admin Page Test";	
}

additionally, each array in the $menu variable now only has 5 keys?

  • The elements in the array are :
  • 0: Menu item name
  • 1: Minimum level or capability required.
  • 2: The URL of the item's file
  • 3: Class
  • 4: ID
  • 5: Icon for top level menu

according to some print_r() results on another site running 3.3.1 the icon is/was key #6

Change History (2)

comment:1 helgatheviking2 years ago

  • Keywords close added
  • Resolution set to invalid
  • Status changed from new to closed
  • Summary changed from add_menu_page does nothing in wp 3.4 alpha to add_menu_page does nothing in wp 3.4 alpha [please close and ignore]

ummmm, awesome facepalm is awesome. please chalk this up to working too late when i should be sleeping.

comment:2 ocean902 years ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
  • Summary changed from add_menu_page does nothing in wp 3.4 alpha [please close and ignore] to add_menu_page does nothing in wp 3.4 alpha
Note: See TracTickets for help on using tickets.