[wp-trac] Re: [WordPress Trac] #10190: Plugin Dependency Class API
WordPress Trac
wp-trac at lists.automattic.com
Tue Jun 16 22:50:13 GMT 2009
#10190: Plugin Dependency Class API
----------------------------+-----------------------------------------------
Reporter: ShaneF | Owner: ShaneF
Type: task (blessed) | Status: new
Priority: normal | Milestone: 2.9
Component: Plugins | Version: 2.9
Severity: normal | Keywords:
----------------------------+-----------------------------------------------
Comment(by logikal16):
One more... this would allow authors to choose whether to see ALL plugins,
or whether to see just ACTIVE ones:
{{{
function get_plugin_versions($status = 'active') {
require_once(ABSPATH . '/wp-admin/includes/plugin.php');
$plugins = array();
$all_plugins = get_plugins();
$active_plugins = get_option('active_plugins');
foreach ($all_plugins as $key => $attr) {
if ('active' != $status || in_array($key, $active_plugins)) {
$plugins[$attr['Name']] = $attr['Version'];
}
}
return $plugins;
}
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/10190#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list