Filter "get_terms" query
I'm currently getting the data from a custom taxonomy using this:
$terms = get_terms(array(
'taxonomy' = 'my_custom_taxonomy_name',
'hide_empty' = true
));
Now, this returns a lot of stuff in each WP_Term
object; term_id
, name
, slug
, term_group
, term_taxonomy_id
, taxonomy
, description
, parent
, count
and filter
.
I only need to get 2 of those: name
and slug
. How can I filter that query so it doesn't returns all that unused data?
Topic terms taxonomy custom-taxonomy Wordpress
Category Web