Reputation: 611
I am trying here with this code,
$all_terms = get_object_taxonomies(get_post_types(array('public' => true ), 'names', 'and' ));
but it is rendering the post_format
, other types like product_visibility
too, but I want only tags and categories, is there any function or process that i can get only tags and categories
Upvotes: 0
Views: 129
Reputation: 11282
You can use get_terms() check the below code.
For Tag.
$post_tag = get_terms( array(
'taxonomy' => 'post_tag',
'hide_empty' => false,
) );
For category.
$category = get_terms( array(
'taxonomy' => 'category',
'hide_empty' => false,
) );
Upvotes: 1