282 | | // Convert urldecoded spaces back into + |
283 | | foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) |
284 | | if ( $t->query_var && isset( $this->query_vars[$t->query_var] ) ) |
285 | | $this->query_vars[$t->query_var] = str_replace( ' ', '+', $this->query_vars[$t->query_var] ); |
| 282 | foreach ( get_taxonomies( array(), 'objects' ) as $taxonomy => $t ) { |
| 283 | if ( $t->query_var && isset( $this->query_vars[ $t->query_var ] ) ) { |
| 284 | // Don't allow non-public taxonomies to be queried outside the admin |
| 285 | if ( ! $t->public && ! is_admin() ) |
| 286 | unset( $this->query_vars[ $t->query_var ] ); |
| 287 | // Convert urldecoded spaces back into + |
| 288 | $this->query_vars[ $t->query_var ] = str_replace( ' ', '+', $this->query_vars[ $t->query_var ] ); |
| 289 | } |
| 290 | } |
| 292 | // Don't allow non-public taxonomies to be queried outside the admin |
| 293 | if ( isset( $this->query_vars['taxonomy'] ) && ! is_admin() ) { |
| 294 | $queryable_taxonomies = get_taxonomies( array( 'public' => true ) ); |
| 295 | if ( is_array( $this->query_vars['taxonomy'] ) ) { |
| 296 | $this->query_vars['taxonomy'] = array_intersect( $this->query_vars['taxonomy'], $queryiable_taxonomies ); |
| 297 | if ( empty( $this->query_vars['taxonomy'] ) ) |
| 298 | unset( $this->query_vars['taxonomy'], $this->query_vars['term'] ); |
| 299 | } elseif ( ! in_array( $this->query_vars['taxonomy'], $queryable_taxonomies ) ) { |
| 300 | unset( $this->query_vars['taxonomy'], $this->query_vars['term'] ); |
| 301 | } |
| 302 | } |
| 303 | |