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

Filters whether the post slug would make a bad attachment slug.

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

add_filter( 'wp_unique_post_slug_is_bad_attachment_slug', 'wp_kama_unique_post_slug_is_bad_attachment_filter', 10, 2 );

/**
 * Function for `wp_unique_post_slug_is_bad_attachment_slug` filter-hook.
 * 
 * @param bool   $bad_slug Whether the slug would be bad as an attachment slug.
 * @param string $slug     The post slug.
 *
 * @return bool
 */
function wp_kama_unique_post_slug_is_bad_attachment_filter( $bad_slug, $slug ){

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

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

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

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

wp_unique_post_slug()
wp_unique_post_slug_is_bad_attachment_slug
wp-includes/post.php 5145
$is_bad_attachment_slug = apply_filters( 'wp_unique_post_slug_is_bad_attachment_slug', false, $slug );

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

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