[wp-trac] Re: [WordPress Trac] #3047: get_plugininfo()
WordPress Trac
wp-trac at lists.automattic.com
Mon Aug 21 08:29:40 GMT 2006
#3047: get_plugininfo()
------------------------------------------+---------------------------------
Reporter: forceagainstsomething | Owner: westi
Type: enhancement | Status: assigned
Priority: normal | Milestone:
Component: Administration | Version: 2.1
Severity: normal | Resolution:
Keywords: bg|has-patch bg|dev-feedback |
------------------------------------------+---------------------------------
Comment (by westi):
Thank you all for the feedback.
'''forceagainstsomething:'''
Your version of get_plugininfo falls over as soon as the included file
that calls it has the parent plugin in the same folder as another plugin.
Then you get back the information about the first plugin that it discovers
in that folder rather than the plugin you were included from.
'''markjaquith:'''
If we assume !__FILE!__ a the second parameter then !__FILE!__ will always
be wp-includes/plugins.php unfortunately.
'''masquerade:'''
Yep lazy loading sounds like a good idea - it does break the possibility
of doing the kind of stuff '''forceagainstsomething''' wanted to do as you
can't lazy load when you don't know the filename - but then again I can
see a way of ''knowing'' the filename of the plugin using the include in
his methodology anyway.
I am about to upload a new version of my patch changes are:
1. Lazy Loading
1. Change call order to $info, $filename
1. $filename is now !__FILE!__ rather than
{{{plugin_basename(!__FILE!__);}}}
If you want to get the info from a included file all you need to do is add
a simple function like so to your base plugin file:
{{{
function my_plugin_getinfo($info) { return get_pluginfo($info, __FILE__);}
}}}
Thanks to a sleepy masquerade on irc for that simple oneliner.
--
Ticket URL: <http://trac.wordpress.org/ticket/3047>
WordPress Trac <http://wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list