You are maybe running an old version of WordPress (before 4.5).
Before WordPress 4.5.0, the first parameter of get_terms() was a taxonomy or list of taxonomies and since 4.5.0, taxonomies should be passed via the ‘taxonomy’ argument in the $args array (that what you are doing, it should work like that).
You will find all the details about these changes in the get_terms() reference page.
UPDATE :
Sorry, I verify my code, and I use get_categories() not get_terms, and that right get_terms() don’t work !
here is a working example to list all my product_cat
$product_categories = get_categories( array(
'taxonomy' => 'product_cat',
'orderby' => 'name',
'pad_counts' => false,
'hierarchical' => 1,
'hide_empty' => false
) );
Hope it helps !
Related Posts:
- Glossary with Custom Post Type
- List all custom post type posts from a given category?
- How to customize the Categories meta box to allow only one category?
- How to get category image custom post type taxonomy in wordpress?
- Category page only displaying the posts from a custom type
- how to get URL of media uploaded to WordPress via media_handle_sideload()
- Custom Post Type Archive Page Filtering
- Allow user to set custom order to a list of custom taxonomies?
- How to get custom posts sub category link
- Conditional statement for if archive page has posts which contain certain taxonomies/categories/tags, show those terms
- Get parent category id from child category page for custom taxonomy
- Category archive in with conjunction with custom post type is empty
- Can I restrict category availability?
- How to Display Posts From Category Within a Custom Taxonomy?
- The Difference Between Categories and Tags and Taxonomies and Terms
- Get category if used in a custom post type
- Get terms for a specfic post from multiple taxonomies in custom post type
- Retrieve Custom Taxonomies with Description and Slug
- Using get_terms() to list terms from one custom taxonomy AND from one specific built-in category
- How to display custom taxonomy term specific post?
- get taxonomies from terms
- create a “add icon” field in taxonomies page
- Sudden 404 pages on product category archives
- Cannot get to work tax_query array for terms
- Get meta values from parent post and save in child post
- WooCommerce change
- Get a list of categories ids
- Using get_terms() as shortcode attribute
- Displaying wp post categories into my custom metabox
- Need to build custom metabox select prev posts by category
- How to manage a bookstore
- Issue On Listing Woocommerce Parent Tag List
- Can’t retrieve custom post type taxonomy term to custom post type editor
- How to determ a custom post type url?
- Set post categories to include parents when setting child category
- get_post_meta returns empty array for terms
- Cannot save Checkbox meta box value from a Custom Post Type
- Adding dropdown select meta box to custom post type – seems restAPI is interfering
- CPT Archive with core Category
- Custom meta box not saving
- Group posts by custom post type
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- Custom meta box data array: foreach not working correctly?
- Undefined Variable – Custom Post Type Meta
- What’s the difference between same wp functions get_posts(); functions in different form?
- Display all posts in main category and 1 subcategory
- How to display product subcategories into my custom post type single page
- Replace li Items with divs with classes
- showing custom post types of a certain category only
- Update post terms with custom taxonomy
- How do I display tags for a custom post type single page?
- Get posts from a custom post type by child categories of a parent category
- Keep display metadata value on backend – Custom Metabox
- Linking to the most recent post in a Custom Post Type
- Getting posts under the custom post type ui category
- Show category ID on custom post type
- How can I auto-assign a CPT post to category in a custom taxonomy when published?
- Filtering WP_Query Dynamically on the Front-End
- Populate dropdown from one custom post type inside another custom post type
- wp_insert_term in a multisite installation
- Push metadata in array
- Get template part using a custom taxonomy term
- Troubles with saving metabox
- get_posts() with custom post type does not work outside page.php
- Get post from custom post type order by two taxonomies
- Get posts by querying taxonomy and certain terms of the taxonomy?
- How to restrict users and admin from creating new taxonomy terms?
- Posts from all the categories are being displayed instead of particular category
- How to check if user meta field is empty in conditional else statement
- Get parent categories of custom post type
- Custom Post Type with Templates using Meta Boxes?
- How to query_post custom posts within default taxonomy?
- Conditional Statement custom post type category
- Show custom post type filtered by category
- Custom Post Type With Categories
- Custom Post Type archive loop separated by term, in specific term order
- Display posts from Custom Post Type in category page on front-end
- using $wpdb to get custom post type with term
- Why is my select meta data not saving?
- WordPress 3.5 Media Uploader – Only allow 1 upload and certain file types
- Categories sorting
- How can I make my custom posts appear in their assigned category url?
- Show posts from two or more custom taxonomy terms
- How to call in Custom Post-Type Categories?
- get_category_parents for custom post type taxonomy
- Add Standard Page Attributes Metabox for Page Parent
- dynamically add a custom field or metabox to custom post type [duplicate]
- Displaying custom taxonomy in the admin list of a custom post type
- Make metabox of custom post type fully autosave- and bulk-/quick-edit compatible
- Separate custom categories from default category
- Custom Post Type uses Custom Tags in add_filter?
- forming WP_Query for posts of all post types but from specific categories
- wp_list_categories() – current-cat class also inside posts?
- Post Quote with image on header for news site
- Showing posts from different categories and from custom post type
- Custom date changer post_date => future – missed schedule error
- Custom post type getting wrong categories and tags
- How to Create an Image Upload Box for Custom Posts?
- Which post does a taxonomy term belongs to?
- How to store multiple values in 1 meta_key with radio input?