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
- Unable to check if plugin is active
- Woocommerce get cart total price in a number format [closed]
- Order get_terms using a Custom Field
- Query Posts by Custom Field ‘Price’
- How to get current post ID in Contact Form 7 wpcf7_before_send_mail hook action
- Using Advanced Custom Fields with WordPress and Lightbox
- How to store ACF custom fields data in a custom table
- Generate Advanced Custom Fields box in custom admin menu page
- Edit Imported advanced Custom Fields from wordpress Dashboard
- Get main parent categories for a product
- How to make a list of companies’ information and display them to user, using custom post types and a custom taxonomy?
- ACF for audio url in wordpress audio shortcode
- remove custom taxonomy metabox form custom post type
- Custom field in TWIG template – Advanced custom fields plugin
- How to delete terms on plugin deactivate?
- Woocommerce custom shared taxonomy
- taxonomy_template filter do not loads custom taxonomy template properly
- How to add rewrite rules and pagination to retrieve attachments files?
- Loop with array of posts using ‘Advanced Custom Fields’ plugin [closed]
- Advanced Custom Fields/User Role Editor – how to hide ACF for certain users?
- Last modified field for user profile?
- Operations with custom fields values in a loop
- Custom Taxonomy Tag Search
- Possible to replicate economist.com’s debate section in wordpress? [closed]
- Get post by ASC from custome field DATE picker
- WP plugins for building a database?
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- WordPress category add image field
- Getting value from Advanced Custom Fields [closed]
- Pull out Advanced Custom Fields in Related post plugin
- How to add contents of a custom field to a taxonomy term list?
- Using a post-signup hook to get user details
- Matching Chapters to a Custom posts [closed]
- auto populate list of questions if user select a category xyz
- 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
- Plugin generated taxonomies’ permalinks with custom placeholders
- ACF: post query, hide duplicate values [closed]
- Redirect to another page using contact form 7? [closed]
- Template filter for custom taxonomy terms
- 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
- Advanced Custom Fields – Get value in other plugin file [closed]
- Slashes stripped in ACF
- Adding class to last list item? Not WP generated
- Default taxonomy template in plugin, override in theme
- Keeping and updating ACF and ACF Pro at the same time
- ACF – How to set the menu order for the relationship field
- Exporting Custom Taxonomy in plugin
- Installed Forca Theme, wonder how I can alter Post editing screen
- 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 validate custom fields in Quick edit/bulk edit?
- What snippet do I need to type to show my ACF field show up on my theme?
- Replace the_content with ACF Flexible Content via function
- Need to edit author permissions | custom taxonomy
- acf backend error handling
- Can’t load the the canges of field groups [duplicate]
- Rewrite/Change custom taxonomy slug
- Custom Taxonomy is Missing (Or Limiting) Items
- 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?
- How to create meta fields with more than 1 relation?
- Will downloading a page builder plugin delete my existing data?
- Taxonomy question
- Returning incorrect $post->ID after installing plugin
- ACF Query result in a new td (echo)
- Get a Taxonomy values in an array
- Else If statement for ACF [closed]
- Is saving multiple options or saving multiple items in one option better?
- CPT-onomies CPT_TAXONOMY->get_terms extremely slow with 6K posts
- ACF: Hide a div or template section when a custom field (in a field group) is empty
- How ACF Advanced Custom Field works with Woocommerce Single Product [closed]
- Failed to update a post when I add a taxonomy to it
- Advanced Custom Fields (ACF) and their Javascript API
- Plugin question, How to insert a colon in a value box
- PHP Fatal error: Cannot redeclare distance() when making a new block
- How to Display News in a Timeline with Headline, Category, and Time?
- How to make a page setting translatable in theme?