Opened 11 years ago
Closed 11 years ago
#26712 closed defect (bug) (duplicate)
Two separate hierarchical CPT's can't have a top-level post with the same slug
Reported by: | jfarthing84 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.8 |
Component: | Posts, Post Types | Keywords: | |
Focuses: | Cc: |
Description
If you create two separate, non-hierarchical post types, you can create a top-level post within both of them with the exact same slug. Yet, if you have two separate hierarchical post types, you can't.
The problem is when it is hierarchical, wp_unique_post_slug
also takes into consideration the post parent. Of course, two top-level posts would both have a post parent of 0.
I understand that the post parent should be checked for child posts as they are under their parent's "tree". However, if there is no post parent, shouldn't that part be left out of the check query?
Attachments (1)
Change History (2)
Note: See
TracTickets for help on using
tickets.
Check for hierarchical post parent in wp_unique_post_slug