find_core_update() –

You appear to be a bot. Output may be restricted

Description

Finds the available update for WordPress core.

Usage

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

Parameters

$version
( string ) required – Version string to find the update for.
$locale
( string ) required – Locale to find the update for.

Returns

object|false The core update offering on success, false on failure.

Source

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

1 to 15 of 15
function find_core_update( $version, $locale ) {
  $from_api = get_site_transient( 'update_core' );

  if ( ! isset( $from_api->updates ) || ! is_array( $from_api->updates ) ) {
    return false;
  }

  $updates = $from_api->updates;
  foreach ( $updates as $update ) {
    if ( $update->current == $version && $update->locale == $locale ) {
      return $update;
    }
  }
  return false;
}
 

 View on GitHub View on Trac