Filter hook 'pre_{$taxonomy}_{$field}'

in WP Core File wp-includes/taxonomy.php at line 1839

View Source

pre_{$taxonomy}_{$field}

Filter Hook
Description
Filters a taxonomy field before it is sanitized. The dynamic portions of the filter name, `$taxonomy` and `$field`, refer to the taxonomy slug and field name, respectively.

Hook Information

File Location wp-includes/taxonomy.php View on GitHub
Hook Type Filter
Line Number 1839

Hook Parameters

Type Name Description
mixed $value Value of the taxonomy field.

Usage Examples

Basic Usage
<?php
// Hook into pre_{$taxonomy}_{$field}
add_filter('pre_{$taxonomy}_{$field}', 'my_custom_filter', 10, 1);

function my_custom_filter($value) {
    // Your custom filtering logic here
    return $value;
}

Source Code Context

wp-includes/taxonomy.php:1839 - How this hook is used in WordPress core
<?php
1834  		 *
1835  		 * @since 2.3.0
1836  		 *
1837  		 * @param mixed $value Value of the taxonomy field.
1838  		 */
1839  		$value = apply_filters( "pre_{$taxonomy}_{$field}", $value );
1840  
1841  		// Back compat filters.
1842  		if ( 'slug' === $field ) {
1843  			/**
1844  			 * Filters the category nicename before it is sanitized.

PHP Documentation

<?php
/**
		 * Filters a taxonomy field before it is sanitized.
		 *
		 * The dynamic portions of the filter name, `$taxonomy` and `$field`, refer
		 * to the taxonomy slug and field name, respectively.
		 *
		 * @since 2.3.0
		 *
		 * @param mixed $value Value of the taxonomy field.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/taxonomy.php
Related Hooks

Related hooks will be displayed here in future updates.