wp_unique_post_slug хук-фильтрWP 3.3.0

Filters the unique post slug.

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

add_filter( 'wp_unique_post_slug', 'wp_kama_unique_post_slug_filter', 10, 6 );

/**
 * Function for `wp_unique_post_slug` filter-hook.
 * 
 * @param string $slug          The post slug.
 * @param int    $post_id       Post ID.
 * @param string $post_status   The post status.
 * @param string $post_type     Post type.
 * @param int    $post_parent   Post parent ID
 * @param string $original_slug The original post slug.
 *
 * @return string
 */
function wp_kama_unique_post_slug_filter( $slug, $post_id, $post_status, $post_type, $post_parent, $original_slug ){

	// filter...
	return $slug;
}
$slug(строка)
The post slug.
$post_id(int)
Post ID.
$post_status(строка)
The post status.
$post_type(строка)
Post type.
$post_parent(int)
Post parent ID
$original_slug(строка)
The original post slug.

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

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

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

wp_unique_post_slug()
wp_unique_post_slug
wp-includes/post.php 5198
return apply_filters( 'wp_unique_post_slug', $slug, $post_id, $post_status, $post_type, $post_parent, $original_slug );

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

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