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
- get_the_term_list without links in 3.1
- Inserting terms in an Hierarchical Taxonomy
- get_term_children for immediate children only (not grandchildren)
- Is there a way to ‘Lock’ a Taxonomy?
- Creating a non-removable taxonomy term
- Return only the custom sub-term for custom post type, do not echo term-parent
- wp_insert_term is adding a term that has no name
- Get terms from multiple taxonomies
- Formating the_terms() function output
- get_terms showing link to category even if all posts are drafts
- Retrieving custom taxonomy in order, but excluding specific tax IDs
- get taxonomy terms for parent and child
- Taxonomy query for children of parents
- Separator for multiple terms
- Contact Form 7 – Populating dropdown list with terms relative to the post
- Add custom taxonomy terms to WordPress menu dynamically & append #slug to url
- How to create a theme template for the taxonomy “root”
- Checking if a Page has an Associated Term?
- What are terms and taxonomy, how they related to post and how these three are stored in database?
- Get multiple term objects by ids
- Echo custom taxonomy term name
- Get Bottom Most Level Taxonomy Terms?
- How can I get WP to build a feed based on multiple taxonomy terms
- get_terms in a taxonomy template
- Set custom post type terms by id without knowing taxonomy
- How to determine the depth of a term in a custom taxonomy?
- get_term_children doesn’t return an array of children terms
- Term count by user
- Catchable fatal error on custom category post
- If post has ANY term attached to it, get the first one only
- Show only the grandchildren (using get_terms)
- remove custom taxonomy base / slug [duplicate]
- Permalink help with default Posts and custom Taxonomy
- Updating / Saving items generated by wp_terms_checklist on frontend
- put custom taxonomy slug in front of their respective term slugs
- Customizing Primary Menu to include custom taxonomy description
- Rewrite rules for varying nested terms of custom taxonomy
- Display all posts that use a custom taxonomy
- Count Number of Posts in Taxonomy Term in Last 24 Hours
- Update table wp_term_taxonomy.count after INSERT INTO via SQL
- How can I reduce amount of ifs and else ifs in this specific block of code?
- Get all attachments by custom taxonomy – term
- Get terms that don’t belong to current post with a shortcode
- 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?
- Duplicate slug/permalink issue
- Exclude product attributes from taxonomy terms loop
- How best to store data (URLs and IDs) extracted from posts and pages using custom taxonomies
- Get name of taxonomies of current page
- Create alphabetical Pagination for custom taxonomy?
- export and import taxonomy terms from one taxonomy to another
- URL rewriting taxonomy term
- Find terms in a custom taxonomy based on the hirearchy
- Wp_query…a type of term a different div
- Show all terms in a custom taxonomy with all child terms wrapped in a ul
- Order taxonomy terms wordpress
- Show single Child Category on Custom Post
- Need equivalent of single_term_slug
- Fill New Taxonomies
- wp_insert_post not adding taxonomy (using wp_set_object_terms)
- Filter “get_terms” query
- custom taxonomies menu
- WordPress search form and search result through ACF field in custom taxonomy
- WordPress Main Menu with dynamic url
- How to create a second set of tags that use the same slug or URL?
- Custom post type term names with ampersand in the term name
- If page is a taxonomy do X, if is a term, do Y
- Getting the parent terms adds additional empty markup [closed]
- Custom taxonomy list in two columns
- get multiple values from $_GET from multiple checkboxes
- Get post terms with hierarchical relationships
- Taxonomy archive link from term id
- Issue On Listing Woocommerce Parent Tag List