get_preferred_from_update_core()WP 2.7.0

Selects the first update version from the update_core option.

Хуков нет.

Возвращает

Объект|Массив|false. The response from the API on success, false on failure.

Использование

get_preferred_from_update_core();

Список изменений

С версии 2.7.0 Введена.

Код get_preferred_from_update_core() WP 6.4.3

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