WordPress开发者和主题制作者的搜索引擎



install_popular_tags ›

Since2.7.0
已弃用n/a
install_popular_tags ( $args = array() )
参数:
  • (array) $args
    Required: No
    默认: array()
返回:
  • (array)
定义在:
文档:

Retrieve popular WordPress plugin tags.



源码

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