We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6ad3fbf commit 8c282c5Copy full SHA for 8c282c5
1 file changed
src/wp-includes/class-wp-query.php
@@ -2156,11 +2156,9 @@ public function get_posts() {
2156
2157
if ( ! $ptype_obj->hierarchical ) {
2158
// Non-hierarchical post types can directly use 'name'.
2159
- if ( is_scalar( $query_vars[ $ptype_obj->query_var ] ) ) {
2160
- $query_vars['name'] = $query_vars[ $ptype_obj->query_var ];
2161
- } else {
2162
- $query_vars['name'] = '';
2163
- }
+ $query_vars['name'] = is_scalar( $query_vars[ $ptype_obj->query_var ] )
+ ? $query_vars[ $ptype_obj->query_var ]
+ : '';
2164
} else {
2165
// Hierarchical post types will operate through 'pagename'.
2166
if ( is_scalar( $query_vars[ $ptype_obj->query_var ] ) ) {
0 commit comments