Ticket #16323: 16323.diff
| File 16323.diff, 1.3 KB (added by , 13 years ago) |
|---|
-
src/wp-includes/query.php
2083 2083 if ( !empty($q['post_type']) && 'any' != $q['post_type'] ) { 2084 2084 foreach ( (array)$q['post_type'] as $_post_type ) { 2085 2085 $ptype_obj = get_post_type_object($_post_type); 2086 if ( ! $ptype_obj || !$ptype_obj->query_var || empty($q[ $ptype_obj->query_var ]))2086 if ( ! $ptype_obj ) 2087 2087 continue; 2088 2088 2089 // Map 'name' to 'postname' for hierarchical post types without a custom query_var 2090 if ( ! $ptype_obj->query_var && $ptype_obj->hierarchical && strpos( $q['name'], '/' ) !== false ) { 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 2089 2098 if ( ! $ptype_obj->hierarchical || strpos($q[ $ptype_obj->query_var ], '/') === false ) { 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 }
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)