Checking if a product ID has taxonomy term attached not working with has_term


I am trying to figure out if a woocommerce product ID has an associated taxonomy term attached to it.

The below id 434 does indeed have an attached rimless term in the material taxonomy but the below returns no.

What am I doing wrong?

if( has_term( 'rimless', 'material', 434 ) ) 
    echo 'yep';
else {
    echo 'no';
Keith Donegan 4 months 0 Answers 13 views 0

Leave an answer