wp_unique_post_slug WordPress Filter Hook

The wp_unique_post_slug hook is used to ensure that a post's slug is unique. This is important because a post's slug is used in its permalink, and if two posts have the same slug, then they will have the same permalink.

apply_filters( 'wp_unique_post_slug', string $slug, int $post_ID, string $post_status, string $post_type, int $post_parent, string $original_slug ) #

Filters the unique post slug.


Parameters

$slug

(string)The post slug.

$post_ID

(int)Post ID.

$post_status

(string)The post status.

$post_type

(string)Post type.

$post_parent

(int)Post parent ID

$original_slug

(string)The original post slug.


Top ↑

Source

File: wp-includes/post.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
3.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More