install_popular_tags

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

WordPress Version: 6.1

/**
 * Retrieves popular WordPress plugin tags.
 *
 * @since 2.7.0
 *
 * @param array $args
 * @return array|WP_Error
 */
function install_popular_tags($args = array())
{
    $key = md5(serialize($args));
    $tags = get_site_transient('poptags_' . $key);
    if (false !== $tags) {
        return $tags;
    }
    $tags = plugins_api('hot_tags', $args);
    if (is_wp_error($tags)) {
        return $tags;
    }
    set_site_transient('poptags_' . $key, $tags, 3 * HOUR_IN_SECONDS);
    return $tags;
}

WordPress Version: 5.6

/**
 * Retrieve popular WordPress plugin tags.
 *
 * @since 2.7.0
 *
 * @param array $args
 * @return array|WP_Error
 */
function install_popular_tags($args = array())
{
    $key = md5(serialize($args));
    $tags = get_site_transient('poptags_' . $key);
    if (false !== $tags) {
        return $tags;
    }
    $tags = plugins_api('hot_tags', $args);
    if (is_wp_error($tags)) {
        return $tags;
    }
    set_site_transient('poptags_' . $key, $tags, 3 * HOUR_IN_SECONDS);
    return $tags;
}

WordPress Version: 5.3

/**
 * Retrieve popular WordPress plugin tags.
 *
 * @since 2.7.0
 *
 * @param array $args
 * @return array
 */
function install_popular_tags($args = array())
{
    $key = md5(serialize($args));
    $tags = get_site_transient('poptags_' . $key);
    if (false !== $tags) {
        return $tags;
    }
    $tags = plugins_api('hot_tags', $args);
    if (is_wp_error($tags)) {
        return $tags;
    }
    set_site_transient('poptags_' . $key, $tags, 3 * HOUR_IN_SECONDS);
    return $tags;
}

WordPress Version: 3.7

/**
 * Retrieve popular WordPress plugin tags.
 *
 * @since 2.7.0
 *
 * @param array $args
 * @return array
 */
function install_popular_tags($args = array())
{
    $key = md5(serialize($args));
    if (false !== $tags = get_site_transient('poptags_' . $key)) {
        return $tags;
    }
    $tags = plugins_api('hot_tags', $args);
    if (is_wp_error($tags)) {
        return $tags;
    }
    set_site_transient('poptags_' . $key, $tags, 3 * HOUR_IN_SECONDS);
    return $tags;
}