Check that the taxonomy matches when calling is_tax() with only a taxonomy argument. props wonderboymusic, see #20590.
git-svn-id: http://core.svn.wordpress.org/trunk@21836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
285660c2a1
commit
a42be1dbb3
|
@ -3192,8 +3192,13 @@ class WP_Query {
|
|||
$tax_array = array_intersect( array_keys( $wp_taxonomies ), (array) $taxonomy );
|
||||
$term_array = (array) $term;
|
||||
|
||||
if ( empty( $term ) ) // Only a Taxonomy provided
|
||||
return isset( $queried_object->taxonomy ) && count( $tax_array ) && in_array( $queried_object->taxonomy, $tax_array );
|
||||
// Check that the taxonomy matches.
|
||||
if ( ! ( isset( $queried_object->taxonomy ) && count( $tax_array ) && in_array( $queried_object->taxonomy, $tax_array ) ) )
|
||||
return false;
|
||||
|
||||
// Only a Taxonomy provided.
|
||||
if ( empty( $term ) )
|
||||
return true;
|
||||
|
||||
return isset( $queried_object->term_id ) &&
|
||||
count( array_intersect(
|
||||
|
|
Loading…
Reference in New Issue