Filter hook 'the_terms'

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

View Source

the_terms

Filter Hook
Description
Filters the list of terms to display.

Hook Information

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

Hook Parameters

Type Name Description
string $term_list List of terms to display.
string $taxonomy The taxonomy name.
string $before String to use before the terms.
string $sep String to use between the terms.
string $after String to use after the terms.

Usage Examples

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

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

Source Code Context

wp-includes/category-template.php:1475 - How this hook is used in WordPress core
<?php
1470  	 * @param string $taxonomy  The taxonomy name.
1471  	 * @param string $before    String to use before the terms.
1472  	 * @param string $sep       String to use between the terms.
1473  	 * @param string $after     String to use after the terms.
1474  	 */
1475  	echo apply_filters( 'the_terms', $term_list, $taxonomy, $before, $sep, $after );
1476  }
1477  
1478  /**
1479   * Checks if the current post has any of given category.
1480   *

PHP Documentation

<?php
/**
	 * Filters the list of terms to display.
	 *
	 * @since 2.9.0
	 *
	 * @param string $term_list List of terms to display.
	 * @param string $taxonomy  The taxonomy name.
	 * @param string $before    String to use before the terms.
	 * @param string $sep       String to use between the terms.
	 * @param string $after     String to use after the terms.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 5
  • File: wp-includes/category-template.php
Related Hooks

Related hooks will be displayed here in future updates.