get_preferred_from_update_core() WordPress Function

This function allows you to get the preferred from update_core() function. It is useful for when you need to programmatically update your WordPress installation.

get_preferred_from_update_core() #

Selects the first update version from the update_core option.


Return

(object|array|false) The response from the API on success, false on failure.


Top ↑

Source

File: wp-admin/includes/update.php

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


Top ↑

Changelog

Changelog
VersionDescription
2.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.