[wp-hackers] add_menu_page in 2.7RC1

Rich Pedley elflop at googlemail.com
Tue Dec 2 11:06:04 GMT 2008


Currently I use the following, which seems to work well, to add a top
level menu item:

add_menu_page(__('eShop','eshop'), __('eShop','eshop'), $eshoplevel,
__FILE__, 'eshop_admin_orders_stats',WP_PLUGIN_URL.'/eshop/eshop.png');

However the link produced is like this:
admin.php?page=eshop/eshop.php

Which works with no problem but this then invalidates the html:
<li class="wp-has-submenu wp-has-current-submenu wp-menu-open menu-top
toplevel_page_eshop/eshop menu-top-first menu-top-last"
id="toplevel_page_eshop/eshop"><img class="wp-menu-image"
src="http://quirm.net/subeshop/wp-content/plugins/eshop/eshop.png"
alt="" /><div class="wp-menu-toggle"><br /></div><a
href='admin.php?page=eshop/eshop.php' class="wp-has-submenu
wp-has-current-submenu wp-menu-open menu-top toplevel_page_eshop/eshop
menu-top-first menu-top-last" tabindex="1">eShop</a>

the offending part being:
toplevel_page_eshop/eshop

the slash shouldn't be there.

So either I'm doing something wrong, or the slash should be removed
automagically.

Additionally I notice there is no highlighting of links when tabbing
through the page.

Rich

-- 
my mind is on a permanent tangent
http://cms.elfden.co.uk/


More information about the wp-hackers mailing list