wp_unique_post_slug filter-hookWP 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;
The post slug.
Post ID.
The post status.
Post type.
Post parent ID
The original post slug.


Since 3.3.0 Introduced.

Where the hook is called

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

Where the hook is used in WordPress

Usage not found.