Uses
| Uses | Description |
|---|---|
| wp-admin/includes/plugin.php: get_plugins() | Check the plugins directory and retrieve all plugin files with plugin data. |
| wp-includes/option.php: get_site_transient() | Retrieves the value of a site transient. |
(array)
File: wp-admin/includes/update.php
function get_plugin_updates() {
$all_plugins = get_plugins();
$upgrade_plugins = array();
$current = get_site_transient( 'update_plugins' );
foreach ( (array) $all_plugins as $plugin_file => $plugin_data ) {
if ( isset( $current->response[ $plugin_file ] ) ) {
$upgrade_plugins[ $plugin_file ] = (object) $plugin_data;
$upgrade_plugins[ $plugin_file ]->update = $current->response[ $plugin_file ];
}
}
return $upgrade_plugins;
} | Version | Description |
|---|---|
| 2.9.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_plugin_updates