wp_generate_tag_cloud
Filter HookDescription
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().Hook Information
File Location |
wp-includes/category-template.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1054 |
Hook Parameters
Type | Name | Description |
---|---|---|
string[]|string
|
$return
|
String containing the generated HTML tag cloud output or an array of tag links if the 'format' argument equals 'array'. |
WP_Term[]
|
$tags
|
An array of terms used in the tag cloud. |
array
|
$args
|
An array of wp_generate_tag_cloud() arguments. |
Usage Examples
Basic Usage
<?php
// Hook into wp_generate_tag_cloud
add_filter('wp_generate_tag_cloud', 'my_custom_filter', 10, 3);
function my_custom_filter($return, $tags, $args) {
// Your custom filtering logic here
return $return;
}
Source Code Context
wp-includes/category-template.php:1054
- How this hook is used in WordPress core
<?php
1049 * or an array of tag links if the 'format' argument
1050 * equals 'array'.
1051 * @param WP_Term[] $tags An array of terms used in the tag cloud.
1052 * @param array $args An array of wp_generate_tag_cloud() arguments.
1053 */
1054 return apply_filters( 'wp_generate_tag_cloud', $return, $tags, $args );
1055 } else {
1056 return $return;
1057 }
1058 }
1059
PHP Documentation
<?php
/**
* 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().
*
* @since 2.3.0
*
* @see wp_generate_tag_cloud()
*
* @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.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/category-template.php
Related Hooks
Related hooks will be displayed here in future updates.