term_(field) filter-hookWP 2.3.0

Filters the term field sanitized for display.

The dynamic portion of the hook name, $field, refers to the term field name.

Usage

add_filter( 'term_(field)', 'wp_kama_term_field_filter', 10, 4 );

/**
 * Function for `term_(field)` filter-hook.
 * 
 * @param mixed  $value    Value of the term field.
 * @param int    $term_id  Term ID.
 * @param string $taxonomy Taxonomy slug.
 * @param string $context  Context to retrieve the term field value.
 *
 * @return mixed
 */
function wp_kama_term_field_filter( $value, $term_id, $taxonomy, $context ){

	// filter...
	return $value;
}
$value(mixed)
Value of the term field.
$term_id(int)
Term ID.
$taxonomy(string)
Taxonomy slug.
$context(string)
Context to retrieve the term field value.

Changelog

Since 2.3.0 Introduced.

Where the hook is called

sanitize_term_field()
term_(field)
wp-includes/taxonomy.php 1822
$value = apply_filters( "term_{$field}", $value, $term_id, $taxonomy, $context );

Where the hook is used in WordPress

wp-includes/default-filters.php 173
add_filter( 'term_name_rss', 'convert_chars' );
wp-includes/default-filters.php 544
add_filter( 'term_link', '_post_format_link', 10, 3 );
wp-includes/ms-default-filters.php 78
add_filter( 'term_id_filter', 'global_terms', 10, 2 );