Filter hook 'pre_wp_unique_post_slug'
in WP Core File wp-includes/post.php at line 5181
Description
Filters the post slug before it is generated to be unique. Returning a non-null value will short-circuit the unique slug generation, returning the passed value instead.
Occurrences
Filename |
Line Number |
wp-includes/post.php |
5181 |
Parameters
Type |
Name |
Description |
string|null |
$override_slug |
Short-circuit return value. |
string |
$slug |
The desired slug (post_name). |
int |
$post_id |
Post ID. |
string |
$post_status |
The post status. |
string |
$post_type |
Post type. |
int |
$post_parent |
Post parent ID. |
PHP Doc
/**
* Filters the post slug before it is generated to be unique.
*
* Returning a non-null value will short-circuit the
* unique slug generation, returning the passed value instead.
*
* @since 5.1.0
*
* @param string|null $override_slug Short-circuit return value.
* @param string $slug The desired slug (post_name).
* @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.
*/