1

I manage a lot of WordPress websites and want to create a system that allows me to check how many plugins on a given site need updating.

So basically what I need is a custom function that returns the number of plugins that are out of date and need updating. I have searched the developer documentation but cannot find a specific function that does this.

Thanks in advance!

2 Answers 2

2

I don't know what your "system" as a whole is intended to look like but the function you want is wp_update_plugins() in wp-includes/update.php.

2
  • Thanks for the answer. I had found this function before but am unsure how to use it; where exactly does it need to be used? When I run it in a theme for testing purposes, it doesn't output anything. Also, if I assign it to a variable and var_dump that variable, I get an output of NULL
    – badcoder
    Commented Dec 22, 2015 at 23:20
  • I will edit with some code.
    – s_ha_dum
    Commented Dec 23, 2015 at 19:23
1

I would highly recommend using WP-CLI for this. It has many handy commands including plugin related. Hope this helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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