You can do this with just get_terms
– this allows you to fetch all (or some) of the terms from one (or more) taxonomies.
By default it excludes ’empty’ terms, so you’ll need to set the arguments appropriately.
//Array of taxonomies to get terms for
$taxonomies = array('category','post_tags','my-tax');
//Set arguments - don't 'hide' empty terms.
$args = array(
'hide_empty' => 0
);
$terms = get_terms( $taxonomies, $args);
$empty_terms=array();
foreach( $terms as $term ){
if( 0 == $term->count )
$empty_terms[] = $term;
}
//$empty_terms contains terms which are empty.
If you wish to obtain an array of registered taxonomies programmatically you can use get_taxonomies()