install_popular_tags() WordPress Function

The install_popular_tags() function is used to retrieve and store the most popular tags from the WordPress.com API.

install_popular_tags( array $args = array() ) #

Retrieves popular WordPress plugin tags.


Parameters

$args

(array)(Optional)

Default value: array()


Top ↑

Return

(array|WP_Error)


Top ↑

Source

File: wp-admin/includes/plugin-install.php

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


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.