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:
Andrew Nacin 2012-09-13 17:15:13 +00:00
parent 285660c2a1
commit a42be1dbb3
1 changed files with 8 additions and 3 deletions

View File

@ -3192,8 +3192,13 @@ class WP_Query {
$tax_array = array_intersect( array_keys( $wp_taxonomies ), (array) $taxonomy ); $tax_array = array_intersect( array_keys( $wp_taxonomies ), (array) $taxonomy );
$term_array = (array) $term; $term_array = (array) $term;
if ( empty( $term ) ) // Only a Taxonomy provided // Check that the taxonomy matches.
return isset( $queried_object->taxonomy ) && count( $tax_array ) && in_array( $queried_object->taxonomy, $tax_array ); 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 ) && return isset( $queried_object->term_id ) &&
count( array_intersect( count( array_intersect(