For your author content display, instead of print_r($all_term_meta);
try a foreach
:
foreach($all_term_meta as $meta) {
return $meta[0];
}
It’s possible you may need to use “echo” instead of “return” but try “return” first.
To control whether or not there is an author tab, update your woo_new_product_tab
function with the same condition:
function woo_new_product_tab( $tabs ) {
$terms = get_the_terms(get_the_ID(), 'book-author' );
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){
// Adds the new tab
$tabs['author_tab'] = array(
'title' => __( 'About the author', 'woocommerce' ),
'priority' => 50,
'callback' => 'woo_new_product_tab_content'
);
}
return $tabs;
}
Related Posts:
- Get value in custom field with taxonomy [closed]
- WP_insert_term how to insert multiple values as taxonomny term?
- Automatically assign taxonomy term if custom meta value exists
- Get child product categories from parent product category in WooCommerce
- Print terms with taxonomy and metabox value
- Get custom category image from menu
- Can I use a Custom Meta Value inside of ‘get_the_terms’?
- How to add contents of a custom field to a taxonomy term list?
- Getting WooCommerce product related child categories
- Query posts using custom taxonomy and selected terms
- How to support fifteen thousand terms in WordPress?
- How to use custom slug and custom templates for custom taxonomy?
- Infinite Scroll appending Next Product Category Term pages
- Cloning product not copying custom taxonomies
- Count tags for current post and save into custom meta field (and update it on post edit)
- Create new Taxonomy, add extra fields, register terms AND extra fields values?
- How to filter a taxonomy meta field to the ‘single_term_title’ filter hook
- Custom order of taxonomy using wp_get_object_terms and woocommerce_term_meta
- Tax query array terms display out of order
- Order posts with custom taxonomy array
- Create heirachy of post terms from array & assign post to terms
- Display woocommerce product_cat child terms with thumbnails
- How do I check if a post has a term with a particular ancestor/parent?
- Hide empty categories on widget
- Set Variant options/attributes values on WooCommerce
- get_terms() duplicate first term of a custom taxonomy
- How do I return all terms from multiple taxonomies?
- Count Number of Posts in Taxonomy Term in Last 24 Hours
- Search Query for Multiple Terms In Same Taxonomy
- WordPress implode & wp_insert_post question
- how to store values in database at hierarchical view
- Best structure for entering recipes in a WordPress theme?
- Order get_terms() by hierarchy
- What does ‘category__in’ mean in queries?
- Update table wp_term_taxonomy.count after INSERT INTO via SQL
- Having Issue on Passing Variable into HTML Class Tag
- WP REST API – get custom taxonomies based on terms & filter
- How can I reduce amount of ifs and else ifs in this specific block of code?
- Weekdays as terms – How to order taxonomy terms by ID in admin panel?
- Returning One custom taxonomy term name
- How to display ACF taxonomy checkbox links on WooCommerce product category archive
- Displaying Custom Taxonomy without a hyperlink
- Are term IDs unique even between multiple custom taxonomies
- What is the action hook that deletes a taxonomy term from the backend? And how to retireve the term id before deleting it?
- Get all attachments by custom taxonomy – term
- Echo custom taxonomy slug
- Get terms that don’t belong to current post with a shortcode
- Get all terms, including unchecked, or get the terms outside loop
- Admin (All posts) stop responding problem
- get_term_link not working
- Copy/clone/associate Custom field to Custom Taxonomy
- How to write sql query to get the posts from a custom taxonomy term name
- How to find taxonomy parent id from child taxonomy page?
- saving meta/custom field to tag
- Get only immediate children (and not grandchildren) of a hierarchical custom taxonomy term
- Proper use of wp_get_object_terms
- Remove a href from this code
- Set term on an attachment using wp_set_object_terms and want to display the full term text but it’s showing a slug instead
- How to get_the_term_list() from multiple taxonomies?
- Output all terms in a custom taxonomy and add a “active” class only to the ones attached to the current post
- How to get posts that contain multiple terms from multiple taxonomies?
- Cannot delete or edit a single term in a custom taxonomy, taxonomy name is wrong?
- How to group all terms children’s in custom taxonomy?
- Display Posts by Custom Taxonomy Chosen Terms
- Show template part if part of term
- How to display a custom taxonomy without a link?
- one post per term taxonomy
- Build filter for post-type + multi taxonomies + multi terms
- How to check if a post has at least 2 terms from a custom taxonomy attached?
- How can I change the output display of my pagination?
- Hide custom Woocommerce taxonomies when empty
- Exclude product attributes from taxonomy terms loop
- Different Taxonomy Values for Each Post
- How do I get term data associated with the current post, where the result is not wrapped in HTML?
- Why does wp_remove_object_terms not work?
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- How best to store data (URLs and IDs) extracted from posts and pages using custom taxonomies
- Can’t get taxonomy ID for each post on archive page
- wp_dropdown_categories – how to save in widget?
- how to get term id from current post type instead of name
- Hide terms if they aren’t the same as the current term
- echo a specific custom taxonomy term on a different custom taxonomy archive
- Display children category images
- Corrupted nav-menu?
- Get name of taxonomies of current page
- The best way to display taxonomies
- Filter through custom taxonomy with an array of taxonomy IDs
- Dynamically set taxonomy term and show admin notice on post save
- WP 4.8 : new taxonomy syntax for get_term_by and get_term_link ?
- Add attribute taxonomy through code don’t appear in admin product page
- Terms change id after importing
- What’s the best way to add taxonomy’s image in 2017?
- Create alphabetical Pagination for custom taxonomy?
- List Top 5 taxonomy terms based on number of post
- Loop through custom taxanomy in post and display custom fields from posts
- delete term from taxonomy and assign in new one
- How to show post list based on taxonomy term?
- export and import taxonomy terms from one taxonomy to another
- Can you hide empty terms using get_term_children?
- How add body_class from wp_termmeta