wp_get_object_terms()
accepts a third parameter which is an array of arguments passed to WP_Term_Query::get_terms
which runs the actual SQL queries for the specific term request, and one of the arguments is named orderby
which accepts term fields like name
and taxonomy
.
So you can use that 3rd parameter and set the orderby
to taxonomy
(and order
to ASC
) like so:
$workshop_terms = wp_get_object_terms( $post->ID, array( 'area', 'group' ), array(
'orderby' => 'taxonomy',
'order' => 'ASC',
) );
Or the other way, is of course, call wp_get_object_terms()
once for each of the taxonomies… ✌🙂