You appear to be a bot. Output may be restricted
Description
Returns array of post_types involved with the taxonomiesWe know it's a taxonomy query so we find which post types are associated with each taxonomy and return the set. Note: The WP_Tax_Query object applies to both tags and categories.
Usage
$array = oik_types_get_involved_taxonomies_post_types( $query );
Parameters
- $query
- ( object ) required – WP_Query object
Returns
array may be emptySource
File name: oik-types/oik-types.phpLines:
1 to 11 of 11
function oik_types_get_involved_taxonomies_post_types( $query ) { $post_types = array(); $queried_terms = $query->tax_query->queried_terms; foreach ( $queried_terms as $taxonomy => $data ) { $taxonomy_object = get_taxonomy( $taxonomy ); //bw_trace2( $taxonomy_object, "taxonomy_object", false ); $post_types += $taxonomy_object->object_type; } //bw_trace2( $post_types, "post_types", false ); return( $post_types ); }View on GitHub