Make WordPress Core

Opened 13 years ago

Closed 13 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:
Priority: normal Milestone:
Component: Posts, Post Types Version: 3.8
Severity: normal Keywords:
Cc: Focuses:

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)

26712.patch (1.1 KB ) - added by jfarthing84 13 years ago.
Check for hierarchical post parent in wp_unique_post_slug

Download all attachments as: .zip

Change History (2)

@jfarthing84
13 years ago

Check for hierarchical post parent in wp_unique_post_slug

#1 @SergeyBiryukov
13 years ago

  • Component GeneralPost Types
  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed

Duplicate of #18962.

Note: See TracTickets for help on using tickets.