get_plugin_updates() – Retrieves plugins with updates available.

You appear to be a bot. Output may be restricted

Description

Retrieves plugins with updates available.

Usage

$array = get_plugin_updates();

Parameters

Returns

array

Source

File name: wordpress/wp-admin/includes/update.php


Lines:

1 to 15 of 15
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;
}
 

 View on GitHub View on Trac