From http://codex.wordpress.com:
$categories = get_categories( $args );
$args = array(
'type' => 'post',
'child_of' => 0,
'parent' => '',
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => 1,
'hierarchical' => 1,
'exclude' => '',
'include' => '',
'number' => '',
'taxonomy' => 'category',
'pad_counts' => false
);
I thought that ‘type’ was the post type. But not. This is the type of category to retrieve. I’ve researched without success.
So, any idea of how to retrieve all categories assigned to all post of specific post type?
A brute force solution that works for any post-taxonomy relationship: