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:

Description

Computes a unique slug for the post, when given the desired slug and some post details.

Related Functions

wp_unique_term_slug, _truncate_post_slug, wp_count_posts, wp_filter_wp_template_unique_post_slug, wp_unique_id

Top Google Results

User discussions

wpseek mobile