find_core_update

The WordPress Core find core update function.

Description

(object|false) find_core_update( (string) $version, (string) $locale ); 

Returns (object|false)

Parameters (2)

0. $version (string)
The version.
1. $locale (string)
The locale.

Usage

  1. if ( !function_exists( 'find_core_update' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/update.php'; 
  3.  
  4. // The version. 
  5. $version = ''; 
  6.  
  7. // The locale. 
  8. $locale = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = find_core_update($version, $locale); 
  12.  

Defined (1)

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

/wp-admin/includes/update.php  
  1. function find_core_update( $version, $locale ) { 
  2. $from_api = get_site_transient( 'update_core' ); 
  3.  
  4. if ( ! isset( $from_api->updates ) || ! is_array( $from_api->updates ) ) 
  5. return false; 
  6.  
  7. $updates = $from_api->updates; 
  8. foreach ( $updates as $update ) { 
  9. if ( $update->current == $version && $update->locale == $locale ) 
  10. return $update; 
  11. return false;