mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-28 15:17:42 +02:00
Prevent multiple hierarchical posts with the same slug from being displayed in single post template.
fixes #28611. Built from https://develop.svn.wordpress.org/trunk@28803 git-svn-id: http://core.svn.wordpress.org/trunk@28612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
64e67b0dbb
commit
d2fc1773ae
@ -2372,11 +2372,11 @@ class WP_Query {
|
|||||||
if ( !$ptype_obj || !$ptype_obj->query_var || empty($q[ $ptype_obj->query_var ]) )
|
if ( !$ptype_obj || !$ptype_obj->query_var || empty($q[ $ptype_obj->query_var ]) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ( ! $ptype_obj->hierarchical || strpos($q[ $ptype_obj->query_var ], '/') === false ) {
|
if ( ! $ptype_obj->hierarchical ) {
|
||||||
// Non-hierarchical post_types & parent-level-hierarchical post_types can directly use 'name'
|
// Non-hierarchical post types can directly use 'name'.
|
||||||
$q['name'] = $q[ $ptype_obj->query_var ];
|
$q['name'] = $q[ $ptype_obj->query_var ];
|
||||||
} else {
|
} else {
|
||||||
// Hierarchical post_types will operate through the
|
// Hierarchical post types will operate through 'pagename'.
|
||||||
$q['pagename'] = $q[ $ptype_obj->query_var ];
|
$q['pagename'] = $q[ $ptype_obj->query_var ];
|
||||||
$q['name'] = '';
|
$q['name'] = '';
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.0-alpha-20140622';
|
$wp_version = '4.0-alpha-20140623';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user