Filter hook 'pre_category_nicename'

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

View Source

pre_category_nicename

Filter Hook
Description
Filters the category nicename before it is sanitized. Use the {@see 'pre_$taxonomy_$field'} hook instead.

Hook Information

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

Hook Parameters

Type Name Description
string $value The category nicename.

Usage Examples

Basic Usage
<?php
// Hook into pre_category_nicename
add_filter('pre_category_nicename', 'my_custom_filter', 10, 1);

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

Source Code Context

wp-includes/taxonomy.php:1852 - How this hook is used in WordPress core
<?php
1847  			 *
1848  			 * @since 2.0.3
1849  			 *
1850  			 * @param string $value The category nicename.
1851  			 */
1852  			$value = apply_filters( 'pre_category_nicename', $value );
1853  		}
1854  	} elseif ( 'rss' === $context ) {
1855  
1856  		/**
1857  		 * Filters the term field for use in RSS.

PHP Documentation

<?php
/**
			 * Filters the category nicename before it is sanitized.
			 *
			 * Use the {@see 'pre_$taxonomy_$field'} hook instead.
			 *
			 * @since 2.0.3
			 *
			 * @param string $value The category nicename.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/taxonomy.php
Related Hooks

Related hooks will be displayed here in future updates.