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.
Использование
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(разное)
- Value of the term field.
- $taxonomy(строка)
- Taxonomy slug.
Список изменений
С версии 2.3.0 | Введена. |
Где вызывается хук
pre_term_(field)
wp-includes/taxonomy.php 1816
$value = apply_filters( "pre_term_{$field}", $value, $taxonomy );
Где используется хук в WordPress
wp-includes/default-filters.php 97
add_filter( 'pre_term_slug', 'sanitize_title' );