wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



find_core_update › WordPress Function

Da2.7.0
Deprecaton/a
find_core_update ( $version, $locale )
Parametri: (2)
  • (string) $version Version string to find the update for.
    Richiesto:
  • (string) $locale Locale to find the update for.
    Richiesto:
Ritorna:
  • (object|false) The core update offering on success, false on failure.
Definito a:
Codex:

Finds the available update for WordPress core.



Sorgenti

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