[wp-hackers] Add_Submenu_Page Q's

Mike Walsh mike_walsh at mindspring.com
Thu Sep 13 13:57:22 GMT 2007


I tried using the suggestion below but I still can't get it to work.  If
anyone could take a look at my example, I'd really appreciate it.  I have
created a single file Menu Tester plugin and posted the source here:
http://www.onefishtwofish.net/menutester.txt - save the file as
menutester.php and drop it in your plugin directory.

I can get the Menu Tester pages to appear under the Manage, Presentation,
and Options tabs without any problems.  I can create a Top Level tab called
Menu Tester but can't create the sublevel tabs and the behavior of the Top
Level tab is also odd.  When the top level Menu Tester is selected, the
Options tab is highlighted and you see all of the option sublevel tabs but
the page content displays what I would expect from the top level Menu
Tester.

Thanks,

Mike

PS:  Is using PasteBin the norm with this group?
------------------------------

Message: 2
Date: Wed, 12 Sep 2007 17:14:34 -0400
From: Mark Jaquith <mark.wordpress at txfx.net>
Subject: Re: [wp-hackers] Add_Submenu_Page Q's
To: wp-hackers at lists.automattic.com
Message-ID: <42110683-ADED-4F59-A5EF-2E9AE63DB8FD at txfx.net>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

On Sep 12, 2007, at 5:01 PM, Mike Walsh wrote:

> Is there something wrong with the example?  Is there some secret to  
> it?

Yes, actually.

Instead of this:

> add_menu_page('Test Toplevel', 'Test Toplevel', 8, 'testtoplevel',  
> 'mt_toplevel_page');

Do this:

> add_menu_page('Test Toplevel', 'Test Toplevel', 8, __FILE__,  
> 'mt_toplevel_page');

Passing a string doesn't work for top-level menus.

See http://trac.wordpress.org/ticket/4907

--
Mark Jaquith
http://markjaquith.com/

Covered Web Services
http://coveredwebservices.com/

WordPress Ninja @ b5media Inc
http://b5media.com/




------------------------------

Message: 3
Date: Wed, 12 Sep 2007 22:16:53 +0100
From: "John Blackbourn" <johnbillion+wp at gmail.com>
Subject: Re: [wp-hackers] Add_Submenu_Page Q's
To: wp-hackers at lists.automattic.com
Message-ID:
	<1fa535a70709121416x4dcd1328n395eddc3dd3571ec at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hey Mike,

The example is correct as far as I can see. Can you pastebin [1] the
code you're using so someone can take a look at it and see where you
might be going wrong?

John.

[1] http://pastebin.ca

******************************************




More information about the wp-hackers mailing list