Before your first foreach
loop, at the top of the script, define an empty array to house what you’re after:
$taxWith_product_cat = array();
Now since you’re looping through all taxonomies and all terms therein, in the terms loop foreach($terms as $term)
, check if the current term is product_cat
. If it is, add the terms taxonomy to the new array:
if ($term->slug == 'product_cat ')
$taxWith_product_cat[] = $taxonomy;
There you have it. Now at the end of the script, you have an array of taxonomies that contain a term of product_cat
:
echo "<pre>".print_r($taxWith_product_cat,true)."</pre>";
Related Posts:
- Limit Number of Taxonomy Terms (Images) Displayed
- Want wp_get_post_terms return in arbitrarily order, how to do?
- List taxonomy terms for post as checkboxes
- Ordering taxonomies by rank
- Getting taxonomy images to display on single-post with their terms
- Where to populate custom terms in custom taxonomy in plugin?
- wp_insert_term() doesnt insert a term
- Smarter navigation plugin and custom taxonomies
- Only return taxonomies that are linked to a category & product
- Why is my custom taxonomy image not displaying?
- Get custom term link archive with prefix
- Add “selected” class to custom taxonomy dropdown search
- ACF Taxonomy Object term Null [closed]
- Create a custom taxonomy’s term form
- Query Custom Post Types on Available Dates
- Using a post-signup hook to get user details
- Matching Chapters to a Custom posts [closed]
- Advanced Custom Fields displaying on tag pages
- ‘No Results Found’ on single post for custom post type
- Custom Fields with Pods not being translated
- auto populate list of questions if user select a category xyz
- is there a way to link one of the field in ACF field group, to a field in a media attachment page? [closed]
- How to remove the inline styles from the content of a WYSIWYG editor field at the time of saving the post?
- add custom filters to the event calendar plugin programatically to frontend [closed]
- How to Display Taxonomy Custom Meta Box Data in Archive Page?
- Can you use another Profile Builder shortcodes through advanced custom fields
- Why Is This Code Causing The Admin Bar to Disappear?
- How to set taxonomy in custom plugin?
- WP_Terms_List_Table Quick Edit not working
- Lists custom taxonomy terms that has specific custom field value assigned to the term (not post)
- dirname( __FILE__) returning wrong directory inside plugin
- “Custom Post Type Permalinks” plugin URL strcuture
- Plugin generated taxonomies’ permalinks with custom placeholders
- ACF: post query, hide duplicate values [closed]
- Redirect to another page using contact form 7? [closed]
- Paid Membership Pro with ACF [closed]
- Template filter for custom taxonomy terms
- ACF only showing up in Homepage but doesn’t appears in all pages
- Checking if a woocommerce attribute is set
- Advanced Custom Fields – Disable Users to Edit Custom Fields
- ‘Organize Series Plugin’ as muti author feature
- WordPress custom taxonomy not showing
- Using ACF default value to autoincrement a number field
- URLs Added to ACF Repeater Field are not working
- Advanced Custom Fields – Get value in other plugin file [closed]
- Slashes stripped in ACF
- Remove Advanced Custom Fields plugin for client?
- Adding class to last list item? Not WP generated
- Default taxonomy template in plugin, override in theme
- How to display terms and conditions in post area?
- Keeping and updating ACF and ACF Pro at the same time
- How do we update a custom file upload field with the Advanced Custom Field plugin?
- Can’t get taxonomy ID for each post on archive page
- Advanced Custom Fields (acf) – Filter Relationship by Taxonomies not Post Type
- ACF – How to set the menu order for the relationship field
- How to get CPT category checkbox list and show post of selected(multiply) checkboxes via ajax?
- Renaming Custom Taxonomy Values
- Conditional custom redirect
- Preview with Custom Post Type Not Working
- Exporting Custom Taxonomy in plugin
- How to display a number of posts based on a Advanced Custom Field (ACF)
- Translation to ACF relationship field
- Installed Forca Theme, wonder how I can alter Post editing screen
- How to get the get the select values created by ACF plugin in wordpress
- Show related posts on single.php, grouped by taxonomy terms, with Advanced Custom Field post object selected
- Advanced custom fields and Slideshow gallery desn’t work together? [closed]
- Plugin for a static piece of text on homepage
- Advanced Custom Fields Plugin – Images not displaying
- How to create repeater field manually, without plugin (ACF Pro)?
- Rename existing cpt and taxonomy with new textdomain
- How to validate custom fields in Quick edit/bulk edit?
- how to create hierachial taxonomy and manage under single post type?
- What snippet do I need to type to show my ACF field show up on my theme?
- Get product categories and add them to a custom taxonomy
- Replace the_content with ACF Flexible Content via function
- Need to edit author permissions | custom taxonomy
- acf backend error handling
- Setting Author on CPT
- Can’t load the the canges of field groups [duplicate]
- Adding category base to url in custom post giving 404?
- Display posts by alphabetical order
- Multisite – Cloning CPT pages + content (including ACF Flexible Content) from site to site
- ACF checkbox return format based on page
- custom fields not displaying on wordpress site
- Rewrite/Change custom taxonomy slug
- ACF Fields are not showing up on Homepage
- Custom Taxonomy is Missing (Or Limiting) Items
- Why Custom fields description is not working WordPress Version 5.4.2?
- Images are broken in Wysiwyg Editor – ACF backend
- make p tag collapsed after 3 rows
- How do I change the functionality of an image slider which is part of ACF?
- Cannot view Custom Post Type no matter what I try
- Change the color of ACF Subtitle output background
- How to create meta fields with more than 1 relation?
- Will downloading a page builder plugin delete my existing data?
- Show custom taxonomy in theme
- Taxonomy question
- Add Custom Field to Post Pages via Plugin
- Taxonomy Category Icon on index page
- Returning incorrect $post->ID after installing plugin