Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$product_tags = wp_get_post_terms( $product->id, 'product_tag' );
if ( ! empty( $product_tags ) ) {
foreach( $product_tags as $tag ) {
if ( $tag->slug === 'tag-slug' && ! is_user_logged_in() ) {
return;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment