Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm running this code to tell me what plugins need updating:

$update_plugins = get_site_transient('update_plugins');

Here is an example return:

Array
(
    [login-lockdown/loginlockdown.php] => stdClass Object
        (
            [id] => 3760
            [slug] => login-lockdown
            [new_version] => v1.5
            [url] => http://wordpress.org/extend/plugins/login-lockdown/
            [package] => http://downloads.wordpress.org/plugin/login-lockdown.1.5.zip
        )

)

From that it doesn't tell me the name of the plugin that needs updating. Is there a WordPress function that you can feed the plugin file name like: ogin-lockdown/loginlockdown.php and return the plugin name? In this case I'd want Login LockDown to be returned.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I think you'll have to work via get_plugins(). It will return a list of all plugins in your plugin folder, indexed by plugin location - which is the same as your array index. This is also what the plugin administration table uses.

If you only need the data from one file you could also call get_plugin_data() directly. get_plugins() basically just calls that function in a loop, and caches the result.

share|improve this answer

Link to the plugin that displays a table listing all plugins that need an update in the admin footer: https://gist.github.com/995560

share|improve this answer
    
Thanks kaiser for the fully fledged code but I was already able to get done what I needed from Jan's answer. –  Brady May 27 '11 at 16:15
    
n/p. Another plugin :) –  kaiser May 27 '11 at 16:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.