Ticket #14330: better-url-array-fix.patch
| File better-url-array-fix.patch, 1.5 KB (added by loushou, 3 years ago) |
|---|
-
wp-includes/classes.php
274 274 $this->query_vars[$wpvar] = $perma_query_vars[$wpvar]; 275 275 276 276 if ( !empty( $this->query_vars[$wpvar] ) ) { 277 $this->query_vars[$wpvar] = (string) $this->query_vars[$wpvar]; 277 if (!is_array($this->query_vars[$wpvar])) { 278 $this->query_vars[$wpvar] = (string) $this->query_vars[$wpvar]; 279 } else { 280 foreach ($this->query_vars[$wpvar] as &$v) 281 $v = (string) $v; 282 } 278 283 if ( isset( $taxonomy_query_vars[$wpvar] ) ) { 279 284 $this->query_vars['taxonomy'] = $taxonomy_query_vars[$wpvar]; 280 285 $this->query_vars['term'] = $this->query_vars[$wpvar]; … … 288 293 // Limit publicly queried post_types to those that are publicly_queryable 289 294 if ( isset( $this->query_vars['post_type']) ) { 290 295 $queryable_post_types = get_post_types( array('publicly_queryable' => true) ); 291 if ( ! in_array( $this->query_vars['post_type'], $queryable_post_types ) ) 292 unset( $this->query_vars['post_type'] ); 296 if (!is_array($this->query_vars['post_type'])) { 297 if ( ! in_array( $this->query_vars['post_type'], $queryable_post_types ) ) 298 unset( $this->query_vars['post_type'] ); 299 } else { 300 foreach ($this->query_vars['post_type'] as $key => &$pType) 301 if ( ! in_array( $pType, $queryable_post_types ) ) 302 unset( $this->query_vars['post_type'][$key] ); 303 } 293 304 } 294 305 295 306 foreach ( (array) $this->private_query_vars as $var) {