wp_unique_term_slug_is_bad_slug хук-фильтрWP 4.3.0

Filters whether the proposed unique term slug is bad.

Использование

add_filter( 'wp_unique_term_slug_is_bad_slug', 'wp_kama_unique_term_slug_is_bad_filter', 10, 3 );

/**
 * Function for `wp_unique_term_slug_is_bad_slug` filter-hook.
 * 
 * @param bool   $needs_suffix Whether the slug needs to be made unique with a suffix.
 * @param string $slug         The slug.
 * @param object $term         Term object.
 *
 * @return bool
 */
function wp_kama_unique_term_slug_is_bad_filter( $needs_suffix, $slug, $term ){

	// filter...
	return $needs_suffix;
}
$needs_suffix(true|false)
Whether the slug needs to be made unique with a suffix.
$slug(строка)
The slug.
$term(объект)
Term object.

Список изменений

С версии 4.3.0 Введена.

Где вызывается хук

wp_unique_term_slug()
wp_unique_term_slug_is_bad_slug
wp-includes/taxonomy.php 3040
if ( apply_filters( 'wp_unique_term_slug_is_bad_slug', $needs_suffix, $slug, $term ) ) {

Где используется хук в WordPress

Использование не найдено.