[wp-trac] Re: [WordPress Trac] #3047: get_plugininfo()

WordPress Trac wp-trac at lists.automattic.com
Sun Aug 20 17:06:39 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 forceagainstsomething):

 For me this new version doesn't work.
 First, I had to change the get_plugininfo() function to get it to work at
 all, by adding this at the top:

 $plugin_filename = plugin_basename($plugin_filename);

 That's if I'm calling the function like: get_plugininfo(__FILE__, 'path');

 Second, this only works in the *base* plugin script, which pretty much
 defeats the purpose.  As I stated in my first reply to you, this function
 should work for *any* one of the numerous scripts that are part of a
 plugin.

 If I have a plugin with this structure:

 /plugins/myplugin/myplugin.php

 /plugins/myplugin/includes/classes/myplugin_class.php

 Your get_plugininfo() will not work if called from the myplugin_class.php
 script.  Mine does.

 Third, if passing the filename to the function is going to be required,
 then I'd suggest making it the second parameter, like this:

 get_plugininfo($info, $plugin_filename)

 That way the parameter can by dropped in the future without breaking
 plugins that are using the function.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3047>
WordPress Trac <http://wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list