Home › Forums › General Issues › Woocommerce Brands – Taxonomy & Checkbox › Reply To: Woocommerce Brands – Taxonomy & Checkbox
Hi @tony-hardy
The link I gave you is using the taxonomy field type instead of the checkbox. I believe you don’t need to use that line of code for the checkbox field type. Maybe something like this:
// Loop through all terms
foreach ($terms as $term){
// Get the featured value. Please check:
// https://www.advancedcustomfields.com/resources/get-values-from-a-taxonomy-term/
$term_featured = get_field('featured', $term);
//Check if it's featured
if($term_featured){
// Add this term object to an array. Don't forget to initialize
// it first.
$matching_terms[] = $term;
}
}
I hope this helps 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.