pre_term_(field)
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
pre_term_(field)
wp-includes/taxonomy.php 1833
$value = apply_filters( "pre_term_{$field}", $value, $taxonomy );
Where the hook is used in WordPress
wp-includes/default-filters.php 102
add_filter( 'pre_term_slug', 'sanitize_title' );