admin管理员组

文章数量:1321050

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';
}

本文标签: Checking if a product ID has taxonomy term attached not working with hasterm