find_core_update

Advertisement

Summery Summery

Finds the available update for WordPress core.

Syntax Syntax

find_core_update( string $version, string $locale )

Parameters Parameters

$version

(Required) Version string to find the update for.

$locale

(Required) Locale to find the update for.

Return Return

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

Source Source

File: 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;
}

Advertisement

Changelog Changelog

Changelog
Version Description
2.7.0 Introduced.

Advertisement

Leave a Reply