[wp-hackers] add_menu_page in 2.7RC1

Rich Pedley elflop at googlemail.com
Wed Dec 3 09:17:35 GMT 2008

2008/12/3 Stephen Rider wrote:
> Instead of __FILE__, you can use any arbitrary string.  Try this:
> add_menu_page(__('eShop','eshop'), __('eShop','eshop'), $eshoplevel,
> 'eshop', 'eshop_admin_orders_stats',WP_PLUGIN_URL.'/eshop/eshop.png');

aha! I used eshop.php to be consistent with my submenu.

Of course you have to change the first parameter of the add submenu
page to match.

This also helped me understand this:
[quote from codex]
In situations where a plugin is creating it's own top-level menu, the
first submenu will normally have the same link title as the top-level
menu and hence the link will be duplicated. The duplicate link title
can be avoided by calling the add_submenu_page function with the
parent and file parameters being given the same value.
and I was able to sort that out as well!

Many thanks!


my mind is on a permanent tangent

More information about the wp-hackers mailing list