wp_unique_post_slug
wp_unique_post_slug ( $slug, $post_id, $post_status, $post_type, $post_parent )
Parameters:- (string) slug The desired slug (post_name).
- (int) post_id Post ID.
- (string) post_status No uniqueness checks are made if the post is still draft or pending.
- (string) post_type Post type.
- (int) post_parent Post parent ID.
Returns:- (string) Unique slug for the post, based on $post_name (with a -1, -2, etc. suffix)
Defined at: - Introduced in WordPress: 2.8.0
- Deprecated in WordPress: —
Description
Computes a unique slug for the post, when given the desired slug and some post details.