find_core_update

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

WordPress Version: 6.3

/**
 * Finds the available update for WordPress core.
 *
 * @since 2.7.0
 *
 * @param string $version Version string to find the update for.
 * @param string $locale  Locale to find the update for.
 * @return object|false The core update offering on success, false on failure.
 */
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;
}

WordPress Version: 5.4

/**
 * Finds the available update for WordPress core.
 *
 * @since 2.7.0
 *
 * @param string $version Version string to find the update for.
 * @param string $locale  Locale to find the update for.
 * @return object|false The core update offering on success, false on failure.
 */
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;
}

WordPress Version: 5.1

/**
 * @param string $version
 * @param string $locale
 * @return object|false
 */
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;
}

WordPress Version: 4.3

/**
 *
 * @param string $version
 * @param string $locale
 * @return object|false
 */
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;
}

WordPress Version: 3.7

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