[wp-trac] [WordPress Trac] #37068: wp_unique_post_slug() should accept `$post` parameter rather than post properties
WordPress Trac
noreply at wordpress.org
Fri Jun 10 03:30:33 UTC 2016
#37068: wp_unique_post_slug() should accept `$post` parameter rather than post
properties
-------------------------------+-----------------------
Reporter: boonebgorges | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.6
Component: Posts, Post Types | Version:
Severity: normal | Keywords: has-patch
Focuses: |
-------------------------------+-----------------------
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
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37068>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list