get_theme_updates

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

WordPress Version: 6.1

/**
 * Retrieves themes with updates available.
 *
 * @since 2.9.0
 *
 * @return array
 */
function get_theme_updates()
{
    $current = get_site_transient('update_themes');
    if (!isset($current->response)) {
        return array();
    }
    $update_themes = array();
    foreach ($current->response as $stylesheet => $data) {
        $update_themes[$stylesheet] = wp_get_theme($stylesheet);
        $update_themes[$stylesheet]->update = $data;
    }
    return $update_themes;
}

WordPress Version: 5.4

/**
 * @since 2.9.0
 *
 * @return array
 */
function get_theme_updates()
{
    $current = get_site_transient('update_themes');
    if (!isset($current->response)) {
        return array();
    }
    $update_themes = array();
    foreach ($current->response as $stylesheet => $data) {
        $update_themes[$stylesheet] = wp_get_theme($stylesheet);
        $update_themes[$stylesheet]->update = $data;
    }
    return $update_themes;
}

WordPress Version: 5.1

/**
 * @return array
 */
function get_theme_updates()
{
    $current = get_site_transient('update_themes');
    if (!isset($current->response)) {
        return array();
    }
    $update_themes = array();
    foreach ($current->response as $stylesheet => $data) {
        $update_themes[$stylesheet] = wp_get_theme($stylesheet);
        $update_themes[$stylesheet]->update = $data;
    }
    return $update_themes;
}

WordPress Version: 4.3

/**
 *
 * @return array
 */
function get_theme_updates()
{
    $current = get_site_transient('update_themes');
    if (!isset($current->response)) {
        return array();
    }
    $update_themes = array();
    foreach ($current->response as $stylesheet => $data) {
        $update_themes[$stylesheet] = wp_get_theme($stylesheet);
        $update_themes[$stylesheet]->update = $data;
    }
    return $update_themes;
}

WordPress Version: 4.0

function get_theme_updates()
{
    $current = get_site_transient('update_themes');
    if (!isset($current->response)) {
        return array();
    }
    $update_themes = array();
    foreach ($current->response as $stylesheet => $data) {
        $update_themes[$stylesheet] = wp_get_theme($stylesheet);
        $update_themes[$stylesheet]->update = $data;
    }
    return $update_themes;
}

WordPress Version: 3.7

function get_theme_updates()
{
    $themes = wp_get_themes();
    $current = get_site_transient('update_themes');
    if (!isset($current->response)) {
        return array();
    }
    $update_themes = array();
    foreach ($current->response as $stylesheet => $data) {
        $update_themes[$stylesheet] = wp_get_theme($stylesheet);
        $update_themes[$stylesheet]->update = $data;
    }
    return $update_themes;
}