[wp-hackers] Programatically retrieve settings page link?

Viper007Bond viper at viper007bond.com
Wed Jun 11 02:03:02 GMT 2008


Global $menu and $submenu and print_r() them. It should become pretty
obvious what's going on.

On Tue, Jun 10, 2008 at 5:35 AM, Stephen Rider <wp-hackers at striderweb.com>
wrote:

> That I know.  The question is:
>
>  It uses the parent script...
>>
>
>
> What is "it"?
>
> Stephen
>
> On Jun 9, 2008, at 11:42 PM, Viper007Bond wrote:
>
>  It uses the parent script and then adds your script's stub/filename as a
>> "page" variable.
>>
>> On Mon, Jun 9, 2008 at 8:41 PM, Stephen Rider <wp-hackers at striderweb.com>
>> wrote:
>>
>>  Can anybody point out the actual function that determines this bit of URL
>>> in the first place?  I'm now writing generalized code in which I _can't_
>>> just hard-code it.
>>>
>>> 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.
>>>>>
>>>> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Viper007Bond | http://www.viper007bond.com/ | http://www.finalgear.com/


More information about the wp-hackers mailing list