How to extract values from Taxonomy Terms field
-
Hi,
First off, great plugin. Probably the second best plugin in the history of WordPress behind ACF itself.
So I’ve been trying to use Taxonomy Terms field as a create a drop down in a Flexible Content field. I am set up a configuration where the user can display a feed of posts based upon the selected term (via get_posts() and the ‘tax_query’ parameter). What I am trying to do is when the user selects a taxonomy term, it automatically loads the value into the ‘taxonomy’ and ‘terms’ parameters in the ‘tax_query’ array in the get_posts() function.
One slight problem: for some reason I cannot access the values (either as an object, name, or id) and I am losing my mind trying to figure out how to get the values.Part of the code is as follows:
$args = array( 'order' => $feed_terms_order, 'orderby' => $feed_terms_orderby, 'tax_query' => array( 'relation' => 'or', array( 'taxonomy' => '' // from taxonomy term field, 'field' => 'term_id', 'terms' => '' // from taxonomy term field, ), ), 'posts_per_page' => $feed_terms_numberposts, );
- The topic ‘How to extract values from Taxonomy Terms field’ is closed to new replies.