[wp-trac] [WordPress Trac] #28017: Slug conflict with hierarchical Custom Post Types
WordPress Trac
noreply at wordpress.org
Thu Apr 24 20:32:47 UTC 2014
#28017: Slug conflict with hierarchical Custom Post Types
-------------------------------+-----------------------------
Reporter: internetrnd | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: 3.9
Severity: normal | Keywords:
Focuses: |
-------------------------------+-----------------------------
To Replicate, create a '''hierarchical ''' custom post type and make sure
it has support for page attributes, lets call it "items"
Publish 3 "items" posts with the following slug and content ( IN THIS
ORDER! )
Post 1: Slug - samsung , No Parent , content : "Welcome to Samsung"
Post 2: Slug - cell-phones , No Parent , content : "Welcome to cell
phones"
Post 3: Slug - samsung , Parent: cell-phones , content : "Welcome to cell
phones by Samsung"
Navigate to http://localhost/items/samsung/ , You will see the content for
Post 3. The correct content should be from Post 1. http://localhost/items
/cell-phones/samsung/ works just fine.
To get the correct results:
Modify wp-includes/query.php , line 2340:
{{{
// ORIGINAL LINE
if ( ! $ptype_obj->hierarchical || strpos($q[ $ptype_obj->query_var ],
'/') === false ) {
// MODIFIED LINE
if ( ! $ptype_obj->hierarchical ) {
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28017>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list