get_plugin_updates

The WordPress Core get plugin updates function.

Description

(array) get_plugin_updates(); 

Returns (array)


Usage

  1. if ( !function_exists( 'get_plugin_updates' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/update.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = get_plugin_updates(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/update.php  
  1. function get_plugin_updates() { 
  2. $all_plugins = get_plugins(); 
  3. $upgrade_plugins = array(); 
  4. $current = get_site_transient( 'update_plugins' ); 
  5. foreach ( (array)$all_plugins as $plugin_file => $plugin_data) { 
  6. if ( isset( $current->response[ $plugin_file ] ) ) { 
  7. $upgrade_plugins[ $plugin_file ] = (object) $plugin_data; 
  8. $upgrade_plugins[ $plugin_file ]->update = $current->response[ $plugin_file ]; 
  9.  
  10. return $upgrade_plugins;