Opened 9 years ago
Last modified 3 years ago
#37068 new enhancement
wp_unique_post_slug() should accept `$post` parameter rather than post properties
Reported by: | boonebgorges | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Posts, Post Types | Keywords: | has-patch |
Focuses: | Cc: |
Description
Breaking this ticket off from #20419.
The function signature for wp_unique_post_slug()
' is currently:
function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_parent )
This is a departure from wp_unique_term_slug()
, which accepts two parameters: $slug
and $term
(where $term
is a term object). For greater consistency, we should prefer a post object in wp_unique_post_slug()
.
There are also some cases where the current function signature requires weird hacks, such as when generating sample permalinks. See #20419. Another argument for standardizing the signature.
Latest patch is at https://core.trac.wordpress.org/attachment/ticket/20419/20419.5.diff
Change History (3)
Note: See
TracTickets for help on using
tickets.