diff --git wp-includes/query.php wp-includes/query.php
index 04286aa..1ff5be3 100644
|
|
|
class WP_Query {
|
| 2080 | 2080 | $where .= " AND DAYOFMONTH($wpdb->posts.post_date)='" . $q['day'] . "'"; |
| 2081 | 2081 | |
| 2082 | 2082 | // If we've got a post_type AND it's not "any" post_type. |
| 2083 | | if ( !empty($q['post_type']) && 'any' != $q['post_type'] ) { |
| 2084 | | foreach ( (array)$q['post_type'] as $_post_type ) { |
| 2085 | | $ptype_obj = get_post_type_object($_post_type); |
| 2086 | | if ( !$ptype_obj || !$ptype_obj->query_var || empty($q[ $ptype_obj->query_var ]) ) |
| | 2083 | if ( ! empty( $q['post_type'] ) && 'any' !== $q['post_type'] ) { |
| | 2084 | foreach ( (array) $q['post_type'] as $_post_type ) { |
| | 2085 | $ptype_obj = get_post_type_object( $_post_type ); |
| | 2086 | if ( ! $ptype_obj ) |
| 2087 | 2087 | continue; |
| 2088 | 2088 | |
| 2089 | | if ( ! $ptype_obj->hierarchical || strpos($q[ $ptype_obj->query_var ], '/') === false ) { |
| | 2089 | // Map 'name' to 'pagename' for hierarchical post types without a custom query_var |
| | 2090 | if ( ! $ptype_obj->query_var && $ptype_obj->hierarchical && false !== strpos( $q['name'], '/' ) ) { |
| | 2091 | $q['pagename'] = $q['name']; |
| | 2092 | $q['name'] = ''; |
| | 2093 | } |
| | 2094 | |
| | 2095 | if ( ! $ptype_obj->query_var || empty($q[ $ptype_obj->query_var ]) ) |
| | 2096 | continue; |
| | 2097 | |
| | 2098 | if ( ! $ptype_obj->hierarchical || false === strpos( $q[ $ptype_obj->query_var ], '/' ) ) { |
| 2090 | 2099 | // Non-hierarchical post_types & parent-level-hierarchical post_types can directly use 'name' |
| 2091 | 2100 | $q['name'] = $q[ $ptype_obj->query_var ]; |
| 2092 | 2101 | } else { |
| 2093 | | // Hierarchical post_types will operate through the |
| | 2102 | // Hierarchical post_types will operate through the 'pagename' query var |
| 2094 | 2103 | $q['pagename'] = $q[ $ptype_obj->query_var ]; |
| 2095 | 2104 | $q['name'] = ''; |
| 2096 | 2105 | } |
| … |
… |
class WP_Query {
|
| 2098 | 2107 | // Only one request for a slug is possible, this is why name & pagename are overwritten above. |
| 2099 | 2108 | break; |
| 2100 | 2109 | } //end foreach |
| 2101 | | unset($ptype_obj); |
| | 2110 | unset( $ptype_obj ); |
| 2102 | 2111 | } |
| 2103 | 2112 | |
| 2104 | 2113 | if ( '' != $q['name'] ) { |