[wp-hackers] release 2.0.4: add_submenu_page() does not work?

Ryan Boren ryan at boren.nu
Sun Aug 20 03:00:12 GMT 2006


AJ Chen wrote:
> In my new plugin - web2x, i found the same code to add submenu works with
> the wordpress code checked out on 5/10/06, but does not work with wordpress
> 2.0.4 release. See the code below.  Running 2.0.4, the submenu "[project]"
> does not appear under Write menu, although the option page is added under
> Options.  Has anybody seen problem with add_submenu_page() function?  
> What's
> the fix?
> 
> add_action('admin_menu', 'w2x_add_pages');
> function w2x_add_pages() {
>    // Add submenu under Write:
>    add_submenu_page('post-new.php', 'Write Project Post', '[project]', 8,
> 'prj', 'w2x_show_prj_post');
> 
>    // Add a new menu under Options:
>    add_options_page('Web2x Options', 'Web2x', 8, __FILE__,
> 'w2x_options_page');
> }

post-new.php does not exist in 2.0.4.  It is 2.1 only.

Ryan


More information about the wp-hackers mailing list