The main point, why i want to do this,
..is to be able to filter these term listings conditionally, such as: if the CPT that is connected with this taxonomy has some meta fields that are empty or have default value in them, we need those CPT-s to be hidden in the term lists.
I wonder, is it possible to achieve this other than building a custom Query with tax_query and meta_query (+ all the custom html output logic, etc.) for it to 'mimic' what i would try to do as written in this question's title?
Important: i need it to work not only on the taxonomy archive pages, but as secondary queries as well. (e.g. widgets, shortcodes)
in other words, how can i make this filtered somehow.. by specific CPT's custom meta values?
function hungarian_locations_tag_cloud(){
$args = array(
'echo' => false,
'taxonomy' => 'locations',
'orderby' => 'name',
'show_count' => false,
'pad_counts' => false,
'hide_empty' => false,
'hierarchical' => true,
'depth' => '1',
'title_li' => '',
'child_of' => '11' // Hungary
);
$lista = '<ul class="location-tags hungary">';
$lista .= wp_list_categories( $args );
$lista .= '</ul>';
return $list;
}
add_shortcode( 'hungarian_locations', 'hungarian_locations_tag_cloud' );
I just would love to save some dev time + keep the code simple, if there is any smart solution on this. Cheers!