Filter hook 'the_tags'

in WP Core File wp-includes/category-template.php at line 1219

View Source

the_tags

Filter Hook
Description
Filters the tags list for a given post.

Hook Information

File Location wp-includes/category-template.php View on GitHub
Hook Type Filter
Line Number 1219

Hook Parameters

Type Name Description
string $tag_list List of tags.
string $before String to use before the tags.
string $sep String to use between the tags.
string $after String to use after the tags.
int $post_id Post ID.

Usage Examples

Basic Usage
<?php
// Hook into the_tags
add_filter('the_tags', 'my_custom_filter', 10, 5);

function my_custom_filter($tag_list, $before, $sep, $after, $post_id) {
    // Your custom filtering logic here
    return $tag_list;
}

Source Code Context

wp-includes/category-template.php:1219 - How this hook is used in WordPress core
<?php
1214  	 * @param string $before   String to use before the tags.
1215  	 * @param string $sep      String to use between the tags.
1216  	 * @param string $after    String to use after the tags.
1217  	 * @param int    $post_id  Post ID.
1218  	 */
1219  	return apply_filters( 'the_tags', $tag_list, $before, $sep, $after, $post_id );
1220  }
1221  
1222  /**
1223   * Displays the tags for a post.
1224   *

PHP Documentation

<?php
/**
	 * Filters the tags list for a given post.
	 *
	 * @since 2.3.0
	 *
	 * @param string $tag_list List of tags.
	 * @param string $before   String to use before the tags.
	 * @param string $sep      String to use between the tags.
	 * @param string $after    String to use after the tags.
	 * @param int    $post_id  Post ID.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 5
  • File: wp-includes/category-template.php
Related Hooks

Related hooks will be displayed here in future updates.