Not sure why your object is returning the non-object notice, but you can set the output of get_term_by
to OBJECT
, ARRAY_A
, or ARRAY_N
– You’ll want to use ARRAY_A
and then access the term ID via $term['term_id']
.
Related Posts:
- Exclude specific slug in ‘get_terms’
- Taxonomy slug by term ID
- How to edit/remove a term that’s in multiple taxonomies?
- How to create drop down for child categories of current taxonomy being viewed?
- Remove pagination from WooCommerce product categories on admin edit navigation menus
- How to dynamically add custom taxonomy terms as a sub-menu of an existing menu item, using custom walker class
- Why does WP rename similar “term name”-slugs in separate taxonomies?
- Outputting an array of term meta values in a custom WooCommerce tab?
- Get child product categories from parent product category in WooCommerce
- Display Taxonomy Terms in an option tag with value being the slug
- Changing taxonomy term by slug (wp_update_term)
- Hide product categories and taxonomy terms in menu if empty
- Sort order by slug for looped child terms of custom taxonomy
- Getting WooCommerce product related child categories
- Echo custom taxonomy slug
- 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
- Corrupted nav-menu?
- How to add a shortcode function that returns the taxonomy slug of the actual post within the loop
- Infinite Scroll appending Next Product Category Term pages
- Cloning product not copying custom taxonomies
- Add A CSS Class To A Menu Item When A Custom Taxonomy Term is Present On Single Post
- generate random slug when adding taxonomy
- Custom order of taxonomy using wp_get_object_terms and woocommerce_term_meta
- Display taxonomy term slugs
- 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
- Change filter id into slug
- 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
- 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
- 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?
- When filtering query on custom taxonomy; main menu dissapears
- Get all attachments by custom taxonomy – term
- 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
- Query posts using custom taxonomy and selected terms
- 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?
- 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
- Check If Taxonomy A and Taxonomy B has same Slug, 301 Auto Redirect Tax A to Tax B if True in WordPress
- How to get_the_term_list() from multiple taxonomies?
- How to support fifteen thousand terms in WordPress?
- 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?
- Duplicate slug/permalink issue
- How can I change the output display of my pagination?
- Hide custom Woocommerce taxonomies when empty
- Exclude product attributes from taxonomy terms loop
- 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?
- Adding a custom taxonomy to “nav_menu_item”
- 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
- Get name of taxonomies of current page
- The best way to display taxonomies
- 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
- Create alphabetical Pagination for custom taxonomy?
- List Top 5 taxonomy terms based on number of post
- 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?
- save custom term – hook create_term doesn’t work
- get_term_by works but get_terms doesn’t?
- URL rewriting taxonomy term
- Display empty custom taxonomies differently than with one with posts
- Find terms in a custom taxonomy based on the hirearchy