[wp-hackers] Programatically retrieve settings page link?

Stephen Rider wp-hackers at striderweb.com
Sat Jun 7 16:20:13 GMT 2008

Yeah, that's basically what I'm doing.  I've been trying to make my  
code as re-usable as possible across different plugins, so I was  
hoping for something a bit more flexible.

(The Settings Page form will be different every time of course, so  
that's not a big deal, but I'm also writing code to add the Settings  
link directly to the Manage Plugins actions.)

Actually, even as I wrote that I think I've figured out what to do.  I  
anticipate a Trac ticket that does something handy. ;)


On Jun 7, 2008, at 4:17 AM, Viper007Bond wrote:

> Use a stub rather than your plugin's path/filename and then just  
> hardcode
> it.
> add_options_page( 'My Plugin', 'My Plugin', 'manage_options',
> 'your-plugin-stub', 'myfunction' );
> On Fri, Jun 6, 2008 at 11:10 PM, Stephen Rider <wp-hackers at striderweb.com 
> >
> wrote:
>> Is there a way to automatically get a plugin page link, e.g.
>> "options-general.php?page=myplugin.php"?
>> I'm adding a "Settings" link in the Plugins page.  At the moment I'm
>> hard-coding it; I would prefer some sort of reusable code that  
>> figures the
>> link out itself.
>> Setting $page = add_submenu_page... returns (in this case)
>> 'design_page_pull-quotes' which isn't going to work.

More information about the wp-hackers mailing list