Ticket #37424: 37424.patch
File 37424.patch, 2.5 KB (added by , 8 years ago) |
---|
-
wp-includes/query.php
1731 1731 } 1732 1732 } 1733 1733 unset( $tax_query ); 1734 1734 1735 1735 if ( empty($qv['author']) || ($qv['author'] == '0') ) { 1736 1736 $this->is_author = false; 1737 1737 } else { … … 2822 2822 $where .= $clauses['where']; 2823 2823 } 2824 2824 2825 if ( empty( $post_type ) && ( $this->is_category || $this->is_tag || $this->is_tax ) ) { 2826 2827 $taxonomy = array_keys ( $this->tax_query->queried_terms ); 2828 2829 if ( count ( $taxonomy ) == 1 ) 2830 { 2831 $taxonomy = array_shift ( $taxonomy ); 2832 $taxonomy = get_taxonomy ( $taxonomy ); 2833 2834 if ( $taxonomy ) 2835 { 2836 if ( empty ( $taxonomy->query_post_types ) ) 2837 { 2838 $post_type = $taxonomy->object_type; 2839 $post_type = array_intersect ( $post_type, get_post_types( array ( 'public' => 1 ) ) ); 2840 } 2841 else 2842 { 2843 $post_type = (array) $taxonomy->query_post_types; 2844 } 2845 } 2846 } 2847 } 2848 2825 2849 if ( $this->is_tax ) { 2826 2850 if ( empty($post_type) ) { 2827 2851 // Do a fully inclusive search for currently registered post types of queried taxonomies -
wp-includes/taxonomy.php
338 338 * @type string $query_var Sets the query var key for this taxonomy. Default `$taxonomy` key. If 339 339 * false, a taxonomy cannot be loaded at `?{query_var}={term_slug}`. If a 340 340 * string, the query `?{query_var}={term_slug}` will be valid. 341 * @type array|string $query_post_types Set the post type(s) to query in the taxonomy archive, defaults to all 342 * publicly attached post types. 341 343 * @type callable $update_count_callback Works much like a hook, in that it will be called when the count is 342 344 * updated. Default _update_post_term_count() for taxonomies attached 343 345 * to post types, which confirms that the objects are published before … … 383 385 'capabilities' => array(), 384 386 'rewrite' => true, 385 387 'query_var' => $taxonomy, 388 'query_post_types' => null, 386 389 'update_count_callback' => '', 387 390 '_builtin' => false, 388 391 );