find_core_update
The WordPress Core find core update function.
Description
Returns (object|false)
Parameters (2)
- 0. $version (string)
- The version.
- 1. $locale (string)
- The locale.
Usage
if ( !function_exists( 'find_core_update' ) ) { require_once ABSPATH . '/wp-admin/includes/update.php'; } // The version. $version = ''; // The locale. $locale = ''; // NOTICE! Understand what this does before running. $result = find_core_update($version, $locale);
Defined (1)
The function is defined in the following location(s).
- /wp-admin/includes/update.php
- 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;
- }