[wp-hackers] best method for figuring out where a plugin is.

Viper007Bond viper at viper007bond.com
Mon Apr 14 01:20:21 GMT 2008


Yeah, using the actual filename is fairly deprecated.

On Sun, Apr 13, 2008 at 5:21 PM, Austin Matzko <if.website at gmail.com> wrote:

> On Sun, Apr 13, 2008 at 7:45 PM, dubayou <dubayou at gmail.com> wrote:
> > im working on a plugin, and when im building links i dont know to call
> >
> >  ?page=widget-profiles/widgetprofiles.php
> >  or
> >  ?page=widgetprofiles.php
> >
> >  in the code if i use just __FILE__ it fails if its installed in a
> folder?
> >  know i have a little monkey hack to fix it for now, but whats the best
> >  way to get the installed path of your plugin.
>
> When calling the admin menu functions, such as add_submenu_page, you
> can pass an arbitrary string for the $file argument, instead of the
> file path itself.
>
> So in your case you could do something like the following:
>
> add_submenu_page('themes.php', __('Widgets Profiles',
> 'widgetprofiles'), __('Widgets Profiles',''widgetprofiles'),
> 'switch_themes', 'widgetprofiles', 'widgetprofiles_run');
> _______________________________________________
> 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