(taxonomy)_(field)
Filters the taxonomy field sanitized for display.
The dynamic portions of the filter name, $taxonomy, and $field, refer to the taxonomy slug and taxonomy field, respectively.
Использование
add_filter( '(taxonomy)_(field)', 'wp_kama_taxonomy_field_filter', 10, 3 );
/**
* Function for `(taxonomy)_(field)` filter-hook.
*
* @param mixed $value Value of the taxonomy field.
* @param int $term_id Term ID.
* @param string $context Context to retrieve the taxonomy field value.
*
* @return mixed
*/
function wp_kama_taxonomy_field_filter( $value, $term_id, $context ){
// filter...
return $value;
}
- $value(разное)
- Value of the taxonomy field.
- $term_id(int)
- Term ID.
- $context(строка)
- Context to retrieve the taxonomy field value.
Список изменений
| С версии 2.3.0 | Введена. |
Где вызывается хук
(taxonomy)_(field)
wp-includes/taxonomy.php 1914
$value = apply_filters( "{$taxonomy}_{$field}", $value, $term_id, $context );