pre_term_(field) filter-hookWP 2.3.0

Filters a term field value before it is sanitized.

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

Usage

add_filter( 'pre_term_(field)', 'wp_kama_pre_term_field_filter', 10, 2 );

/**
 * Function for `pre_term_(field)` filter-hook.
 * 
 * @param mixed  $value    Value of the term field.
 * @param string $taxonomy Taxonomy slug.
 *
 * @return mixed
 */
function wp_kama_pre_term_field_filter( $value, $taxonomy ){

	// filter...
	return $value;
}
$value(mixed)
Value of the term field.
$taxonomy(string)
Taxonomy slug.

Changelog

Since 2.3.0 Introduced.

Where the hook is called

sanitize_term_field()
pre_term_(field)
wp-includes/taxonomy.php 1815
$value = apply_filters( "pre_term_{$field}", $value, $taxonomy );

Where the hook is used in WordPress

wp-includes/default-filters.php 91
add_filter( 'pre_term_slug', 'sanitize_title' );