find_core_update()
Finds the available update for WordPress core.
No Hooks.
Returns
Object|false. The core update offering on success, false on failure.
Usage
find_core_update( $version, $locale );
- $version(string) (required)
- Version string to find the update for.
- $locale(string) (required)
- Locale to find the update for.
Changelog
| Since 2.7.0 | Introduced. |
find_core_update() find core update code WP 6.8.3
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;
}