函数原型
install_popular_tags( array $args = array() ): array|WP_Error
函数描述
Retrieves popular WordPress plugin tags.
是否弃用
未弃用
函数参数
-
$args
array
Optional Default:
array()
函数返回值
array|WP_Error
函数位置
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;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.7.0 | Introduced. |

