hm-core.functions.php
/**
 * Checks where a given term of term from a given taxonomy was queried by in global $wp_query
 *
 * @param string filepart
 * @param mixed wp_args style argument list
 */
Checks where a given term of term from a given taxonomy was queried by in global $wp_query
@param string filepart
@param mixed wp_args style argument list
Checks where a given term of term from a given taxonomy was queried by in global $wp_query @param string filepart @param mixed wp_args style argument list
function hm_is_queried_object( $term_or_taxonomy ) {
	global $wp_query;
	if ( is_string( $term_or_taxonomy ) ) {
		if ( $wp_query->tax_query ) {
			foreach ( $wp_query->tax_query->queries as $query ) {
				if ( $query['taxonomy'] == $term_or_taxonomy )
					return true;
			}
		}
		if ( ! empty( $wp_query->_post_parent_query ) ) {
			foreach ( $wp_query->_post_parent_query->tax_query->queries as $query ) {
				if ( $query['taxonomy'] == $term_or_taxonomy )
					return true;
			}
		}
	} else if ( is_object( $term_or_taxonomy ) ) {
		foreach ( $wp_query->tax_query->queries as $query ) {
			if ( $query['field'] == 'slug' && in_array( $term_or_taxonomy->slug, $query['terms'] ) )
				return true;
			if ( in_array( $term_or_taxonomy->term_id, $query['terms'] ) )
				return true;
		}
	}
}
function hm_is_queried_object ( $ term_or_taxonomy ) { global $ wp_query ; if ( is_string ( $ term_or_taxonomy ) ) { if ( $ wp_query -> tax_query ) { foreach ( $ wp_query -> tax_query -> queries as $ query ) { if ( $ query [ 'taxonomy' ] == $ term_or_taxonomy ) return true ; } } if ( ! empty ( $ wp_query -> _post_parent_query ) ) { foreach ( $ wp_query -> _post_parent_query -> tax_query -> queries as $ query ) { if ( $ query [ 'taxonomy' ] == $ term_or_taxonomy ) return true ; } } } else if ( is_object ( $ term_or_taxonomy ) ) { foreach ( $ wp_query -> tax_query -> queries as $ query ) { if ( $ query [ 'field' ] == 'slug' && in_array ( $ term_or_taxonomy -> slug , $ query [ 'terms' ] ) ) return true ; if ( in_array ( $ term_or_taxonomy -> term_id , $ query [ 'terms' ] ) ) return true ; } } }
Checks where a given term of term from a given taxonomy was queried by in global $wp_query
 @param string filepart
 @param mixed wp_args style argument list
Checks where a given term of term from a given taxonomy was queried by in global $wp_query @param string filepart @param mixed wp_args style argument list
// tax