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]
- Woocommerce get cart total price in a number format [closed]
- How to share category taxonomy with custom post type (The Event Calendar plugin)
- Get value in custom field with taxonomy [closed]
- Custom Taxonomy in plugin and template
- Generate Advanced Custom Fields box in custom admin menu page
- Get main parent categories for a product
- Add .html extension to custom post type taxonomies
- Visual Composer vs. Advanced Custom Fields [closed]
- Custom Post Type causes Page Not Found
- How to delete terms on plugin deactivate?
- How do I add advanced custom fields / meta fields to Elasticsearch? [closed]
- Plugin allowing for artists, events and venues
- Can’t create term for product attribute
- custom taxonomy and custom post type url conflict
- Using ACF to display data on all pages
- Show Heirachy of categories in WP Download Monitor
- Custom Taxonomy Tag Search
- Possible to replicate economist.com’s debate section in wordpress? [closed]
- WP_Query ordering numbers as letters
- WordPress category add image field
- Where (or when) should I register a new taxonomy?
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- How can you include a theme template file from within a plugin (i.e. WooCommerce’s Shop page)?
- Inserting HTML tag with ACF into shortcode
- Widget for adding HTML markup to a page
- Advanced Custom Fields plugin – get text from editor field and save it in a variable
- How to add contents of a custom field to a taxonomy term list?
- Using a post-signup hook to get user details
- 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?
- How to Display Taxonomy Custom Meta Box Data in Archive Page?
- 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
- Redirect to another page using contact form 7? [closed]
- ACF only showing up in Homepage but doesn’t appears in all pages
- Checking if a woocommerce attribute is set
- URLs Added to ACF Repeater Field are not working
- Slashes stripped in ACF
- Remove Advanced Custom Fields plugin for client?
- How to display terms and conditions in post area?
- How do we update a custom file upload field with the Advanced Custom Field plugin?
- Advanced Custom Fields (acf) – Filter Relationship by Taxonomies not Post Type
- How to get CPT category checkbox list and show post of selected(multiply) checkboxes via ajax?
- 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)
- How to get the get the select values created by ACF plugin in wordpress
- 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?
- Get product categories and add them to a custom taxonomy
- Can’t load the the canges of field groups [duplicate]
- 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
- ACF Fields are not showing up on Homepage
- Cannot view Custom Post Type no matter what I try
- Add Custom Field to Post Pages via Plugin
- Taxonomy Category Icon on index page
- ACF Query result in a new td (echo)
- ACF Taxonomy search on backend (Relationship field)
- Else If statement for ACF [closed]
- plugin_dir_url(__FILE__) searches parent theme in ACF extension
- “Tree view” for wp_dropdown_categories() markup
- Save selectlist value (taxonomy) in wp:wp_set_object_terms
- Show similar category portfolio items?
- CPT-onomies CPT_TAXONOMY->get_terms extremely slow with 6K posts
- How to use categories in the URL with Advanced Custom Fields?
- Can’t pull metadata for a term in my theme’s function.php
- Advanced Custom Field User Help URL
- Find And Add Category to Posts
- Define constant for one plugin in mu-plugin
- How can I add the custom taxonomy categories to the posts and pages?
- Award points if a specific custom taxonomy is selected – Cubepoints
- Hide/Show panel not showing – ACF
- Pulling Advanced Custom Fields from other pages
- How to list the categories by custom taxonomy created?
- Custom time field won’t sort regardless of format
- Failed to update a post when I add a taxonomy to it