[wp-hackers] Selected Menu Problems

Ryan Boren ryan at boren.nu
Tue Nov 21 03:41:35 GMT 2006


joshua eichorn wrote:
> I'm running wordpress from trunk, updated this morning
> 
> I have a plug-in that is adding 3 new pages as submenu items to the profile
> 
> Menu wise im doing:
> add_submenu_page('profile.php','item1','Item 
> 1','custom_role',__FILE__,'method1');
> add_submenu_page('profile.php','item2','Item 
> 2','custom_role',__FILE__,'method2');
> add_submenu_page('profile.php','item3','Item 
> 3','custom_role',__FILE__,'method3');
> 
> The menu items are added successfully and the methods are called but all 
> 3 pages are shown selected when any one of them is selected.
> Am I doing something wrong with the menu additions or is this just a bug.

Our API is lame and confusing. :-)  Since you are using method 
callbacks, try replacing __FILE__ with any arbitrary string.  Make each 
one unique.

Ryan


More information about the wp-hackers mailing list