Filter hook 'wp_unique_term_slug'

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

View Source

wp_unique_term_slug

Filter Hook
Description
Filters the unique term slug.

Hook Information

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

Hook Parameters

Type Name Description
string $slug Unique term slug.
object $term Term object.
string $original_slug Slug originally passed to the function for testing.

Usage Examples

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

function my_custom_filter($slug, $term, $original_slug) {
    // Your custom filtering logic here
    return $slug;
}

Source Code Context

wp-includes/taxonomy.php:3172 - How this hook is used in WordPress core
<?php
3167  	 *
3168  	 * @param string $slug          Unique term slug.
3169  	 * @param object $term          Term object.
3170  	 * @param string $original_slug Slug originally passed to the function for testing.
3171  	 */
3172  	return apply_filters( 'wp_unique_term_slug', $slug, $term, $original_slug );
3173  }
3174  
3175  /**
3176   * Updates term based on arguments provided.
3177   *

PHP Documentation

<?php
/**
	 * Filters the unique term slug.
	 *
	 * @since 4.3.0
	 *
	 * @param string $slug          Unique term slug.
	 * @param object $term          Term object.
	 * @param string $original_slug Slug originally passed to the function for testing.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/taxonomy.php
Related Hooks

Related hooks will be displayed here in future updates.