wp_unique_post_slug_is_bad_flat_slug хук-фильтрWP 3.1.0

Filters whether the post slug would be bad as a flat slug.

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

add_filter( 'wp_unique_post_slug_is_bad_flat_slug', 'wp_kama_unique_post_slug_is_bad_flat_filter', 10, 3 );

/**
 * Function for `wp_unique_post_slug_is_bad_flat_slug` filter-hook.
 * 
 * @param bool   $bad_slug  Whether the post slug would be bad as a flat slug.
 * @param string $slug      The post slug.
 * @param string $post_type Post type.
 *
 * @return bool
 */
function wp_kama_unique_post_slug_is_bad_flat_filter( $bad_slug, $slug, $post_type ){

	// filter...
	return $bad_slug;
}
$bad_slug(true|false)
Whether the post slug would be bad as a flat slug.
$slug(строка)
The post slug.
$post_type(строка)
Post type.

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

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

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

wp_unique_post_slug()
wp_unique_post_slug_is_bad_flat_slug
wp-includes/post.php 5169
$is_bad_flat_slug = apply_filters( 'wp_unique_post_slug_is_bad_flat_slug', false, $slug, $post_type );

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

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