Skip to content

Instantly share code, notes, and snippets.

@SiR-DanieL
Created March 16, 2015 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SiR-DanieL/7a14ec9c9140dfc169dd to your computer and use it in GitHub Desktop.
Save SiR-DanieL/7a14ec9c9140dfc169dd to your computer and use it in GitHub Desktop.
$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