WPDev.one
Core Function
View Source on Trac ↗

wp_filter_wp_template_unique_post_slug()

wp_filter_wp_template_unique_post_slug( mixed $override_slug, mixed $slug, mixed $post_id, mixed $post_status, mixed $post_type )

Generates a unique slug for templates.

Parameters 5 required

Name / Type Description
$override_slug
string

The filtered value of the slug (starts as `null` from apply_filter).

Required
$slug
string

The original/un-filtered slug (post_name).

Required
$post_id
int

Post ID.

Required
$post_status
string

No uniqueness checks are made if the post is still draft or pending.

Required
$post_type
string

Post type.

Required

Return Value

(string)
The original, desired slug.

Function Information

Since Version
5.8.0
Source File
wp-includes/theme-templates.php
Advertisement