get_preferred_from_update_core()WP 2.7.0

Selects the first update version from the update_core option.

No Hooks.

Return

Object|Array|false. The response from the API on success, false on failure.

Usage

get_preferred_from_update_core();

Changelog

Since 2.7.0 Introduced.

get_preferred_from_update_core() code WP 6.5.2

function get_preferred_from_update_core() {
	$updates = get_core_updates();

	if ( ! is_array( $updates ) ) {
		return false;
	}

	if ( empty( $updates ) ) {
		return (object) array( 'response' => 'latest' );
	}

	return $updates[0];
}