get_preferred_from_update_core

The timeline below displays how wordpress function get_preferred_from_update_core has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.4

/**
 * WordPress Administration Update API
 *
 * @package WordPress
 * @subpackage Administration
 */
/**
 * Selects the first update version from the update_core option.
 *
 * @since 2.7.0
 *
 * @return object|array|false The response from the API on success, false on failure.
 */
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];
}

WordPress Version: 4.3

/**
 * WordPress Administration Update API
 *
 * @package WordPress
 * @subpackage Administration
 */
/**
 * Selects the first update version from the update_core option.
 *
 * @return object|array|false The response from the API on success, false on failure.
 */
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];
}

WordPress Version: 3.9

/**
 * WordPress Administration Update API
 *
 * @package WordPress
 * @subpackage Administration
 */
/**
 * Selects the first update version from the update_core option.
 *
 * @return bool|object The response from the API on success, false on failure.
 */
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];
}

WordPress Version: 3.7

/**
 * WordPress Administration Update API
 *
 * @package WordPress
 * @subpackage Administration
 */
/**
 * Selects the first update version from the update_core option
 *
 * @return object the response from the API
 */
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];
}