Filters the post slug before it is generated to be unique.
Description
Returning a non-null value will short-circuit the unique slug generation, returning the passed value instead.
Parameters
$override_slug
string|null- Short-circuit return value.
$slug
string- The desired slug (post_name).
$post_id
int- Post ID.
$post_status
string- The post status.
$post_type
string- Post type.
$post_parent
int- Post parent ID.
Source
$override_slug = apply_filters( 'pre_wp_unique_post_slug', null, $slug, $post_id, $post_status, $post_type, $post_parent );
Changelog
Version | Description |
---|---|
5.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.