get_the_terms() returns FALSE if there are no terms in the taxonomy, so you could check for that.
$authors = get_the_terms( $post->ID , 'product_author' );
if ( FALSE != $authors ) :
// Do something
endif;
If you want to avoid displaying empty terms, ie. terms that have no objects attached to them, use get_terms() instead, because you can pass a parameter to filter them:
$terms = get_terms(
array(
'object_ids' => $post->ID,
'taxonomy' => 'product_author',
'hide_empty' => TRUE,
) );
Related Posts:
- How to get WooCommerce Product Category Link by ID?
- Approach for saving a product attribute values with a custom UI in a woocommerce+dokan set up [closed]
- Set download limit and expiry for WooCommerce downloadable products in specific categories
- Remove pagination from WooCommerce product categories on admin edit navigation menus
- Taxonomy , subtaxonomy,child taxonomy of a product woocommerce
- Woocommerce custom taxonomies page
- Outputting an array of term meta values in a custom WooCommerce tab?
- Programatically added attribute, set to ‘show on product page’ automatically. Woocommerce [closed]
- Get child product categories from parent product category in WooCommerce
- Top level parent taxonomy ID
- Woocommerce product search result layout page
- Filter WooCommerce admin products list by a custom taxonomy
- Woocommerce: How to change the add to cart text in a certain category? [closed]
- Catchable fatal error on custom category post
- Get custom category image from menu
- Hide product categories and taxonomy terms in menu if empty
- Display related products based on 2 specific product attributes values in WooCommerce
- How to target parent product category and its children using WooCommerce?
- woocommerce custom product category template
- Getting WooCommerce product related child categories
- Hiding taxonomies with no children WP_Query & tax_query
- How to display ACF taxonomy checkbox links on WooCommerce product category archive
- Add attribute taxonomy through code don’t appear in admin product page
- Showing custom taxonomy in woocommerce signle product page
- Adding term to a custom taxonomy based on term from product category
- Warning: Undefined variable $post in C:\xampp\htdocs\… after PHP upgrade
- Admin only taxonomies?
- Fill New Taxonomies
- Infinite Scroll appending Next Product Category Term pages
- How to exclude woocommerece product category in search results?
- Cloning product not copying custom taxonomies
- Check if any available product has specific attribute
- how to show product custom taxonomies in woocommerce rest api
- WordPress search form and search result through ACF field in custom taxonomy
- Get user created Woocommerce attributes ( taxonomies ) [closed]
- Custom order of taxonomy using wp_get_object_terms and woocommerce_term_meta
- How do you search for a post by custom taxonomy?
- Display woocommerce product_cat child terms with thumbnails
- Woocommerce – how to get and display selected variations on single product page
- How do I check if a post has a term with a particular ancestor/parent?
- Creating a custom archive page for WooCommerce products based on tags
- Hide empty categories on widget
- Change filter id into slug
- Set Variant options/attributes values on WooCommerce
- Custom taxonomies capabilities
- Can’t get a custom template taxonomy page to display
- Display category posts grouped by taxonomy
- Can I turn off write-in tags/taxonomies?
- Using tax_query creates a 1 = 0 or 1 = 1 in $wp_query->request
- Displaying the Name of the Queried Taxonomy Term on a Term Archive Page?
- Post tags saving as both tag name & tag ID on post update when tags are displayed as checkboxes
- Taxonomy query for children of parents
- Removing the base “Author” or changing it to something else. is it possible?
- how to get title to custom tags page
- How to redirect custom post type archive to first term of associated taxonomy?
- Refresh Taxonomies
- Get Bottom Most Level Taxonomy Terms?
- Get custom taxonomy description with paragraph tags
- Get pages only with a specific taxonomy
- Share taxonomy between user and posts?
- Displaying custom taxonomy terms active trail
- How to obtain the link/URL to the feed of a custom taxonomy?
- get_term_children doesn’t return an array of children terms
- Get taxonomy parent using child slug (from merged taxonomies)
- add taxonomy as one of menu items
- Creating a custom search form
- One query to get posts and their taxonomy terms
- Conditional display for custom fields/taxonomy
- Query posts by taxonomy with current term
- problem in taxonomy-{taxonomy}.php pagination
- Rewrite rules for varying nested terms of custom taxonomy
- Copying taxonomy term to custom field
- How can I unregister a custom taxonomy?
- Get posts in certain Taxonomy terms for the current page url
- Get all attachments by custom taxonomy – term
- Get terms that don’t belong to current post with a shortcode
- {$taxonomy}_edit_form_fields not working
- Adding a custom taxonomy to “nav_menu_item”
- pagination not working on custom-taxonomy template
- Limit Display Number Of Taxonomy Term
- Sort and paginate custom post taxonomies alphabetically
- Current taxonomy name (not term!) given a post ID
- 404 Error on Custom Post Type / Custom Taxonomy
- Terms added to custom taxonomy for custom post type only appear in Rest when added in code
- Gutenberg Block Editor – Create block with dynamic content
- Custom taxonomy not showing in grid view for ‘attachment’ post type
- How To Create Dynamic Permalink To Custom Taxonomy List of Current Posts?
- How to create archive pages for metadata query generated posts (so without taxonomy)?
- How to get list of custom taxonomies based on custom post type
- how to filter the data’s comparison operators (>= &
- Sort Taxonomy List by Custom Values
- How to filter a taxonomy meta field to the ‘single_term_title’ filter hook
- Custom taxonomy rewrite in permalinks for posts gives 404 on pages
- Query pages by child term
- Custom taxonomy applied to links [duplicate]
- Custom Taxonomy registered with multiple custom posts
- Insert term description programmatically into hierarchical custom taxonomy
- Get all taxonomy posts by id
- Taxonomy Child Not Updating Unless I Click Update Twice
- How to enforce a requirement for custom taxonomy