install_popular_tags()
Retrieves popular WordPress plugin tags.
Хуков нет.
Возвращает
Массив|WP_Error.
Использование
install_popular_tags( $args );
- $args(массив)
- .
По умолчанию:array()
Список изменений
| С версии 2.7.0 | Введена. |
Код install_popular_tags() install popular tags WP 6.9.1
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;
}