| | 289 | } |
| | 290 | |
| | 291 | // Limit publicly queried taxonomy to those that are public |
| | 292 | // for taxonomy query_vars |
| | 293 | if ( isset( $this->query_vars[$t->query_var] ) ) { |
| | 294 | // Only get $queryable_taxonomies if needed |
| | 295 | if ( null === $queryable_taxonomies ) |
| | 296 | $queryable_taxonomies = get_taxonomies( array( 'public' => true ) ); |
| | 297 | |
| | 298 | if ( ! is_array( $this->query_vars[$t->query_var] ) ) { |
| | 299 | if ( ! in_array( $this->query_vars[$t->query_var], $queryable_taxonomies ) ) { |
| | 300 | unset( $this->query_vars[$t->query_var] ); |
| | 301 | } |
| | 302 | } else { |
| | 303 | $this->query_vars[$t->query_var] = array_intersect( $this->query_vars[$t->query_var], $queryable_taxonomies ); |
| | 304 | } |
| | 305 | } |
| | 306 | } |
| | 307 | |
| | 308 | // Limit publicly queried taxonomy to those that are public |
| | 309 | // for query_var taxonomy |
| | 310 | if ( isset( $this->query_vars['taxonomy'] ) ) { |
| | 311 | // Only get $queryable_taxonomies if needed |
| | 312 | if ( null === $queryable_taxonomies ) |
| | 313 | $queryable_taxonomies = get_taxonomies( array( 'public' => true ) ); |
| | 314 | |
| | 315 | if ( ! is_array( $this->query_vars['taxonomy'] ) ) { |
| | 316 | if ( ! in_array( $this->query_vars['taxonomy'], $queryable_taxonomies ) ) { |
| | 317 | unset( $this->query_vars['taxonomy'] ); |
| | 318 | unset( $this->query_vars['term'] ); |
| | 319 | } |
| | 320 | } else { |
| | 321 | $this->query_vars['taxonomy'] = array_intersect( $this->query_vars['taxonomy'], $queryable_taxonomies ); |
| | 322 | } |
| | 323 | } |