wp_generate_tag_cloud
Filters the generated output of a tag cloud.
The filter is only evaluated if a true value is passed to the $filter argument in wp_generate_tag_cloud().
Использование
add_filter( 'wp_generate_tag_cloud', 'wp_kama_generate_tag_cloud_filter', 10, 3 );
/**
* Function for `wp_generate_tag_cloud` filter-hook.
*
* @param string[]|string $return String containing the generated HTML tag cloud output or an array of tag links if the 'format' argument equals 'array'.
* @param WP_Term[] $tags An array of terms used in the tag cloud.
* @param array $args An array of wp_generate_tag_cloud() arguments.
*
* @return string[]|string
*/
function wp_kama_generate_tag_cloud_filter( $return, $tags, $args ){
// filter...
return $return;
}
- $return(string[]|строка)
- String containing the generated HTML tag cloud output or an array of tag links if the 'format' argument equals 'array'.
- $tags(WP_Term[])
- An array of terms used in the tag cloud.
- $args(массив)
- An array of wp_generate_tag_cloud() arguments.
Список изменений
| С версии 2.3.0 | Введена. |
Где вызывается хук
wp-includes/category-template.php 1054
return apply_filters( 'wp_generate_tag_cloud', $return, $tags, $args );