I hope I understand your question. You are looking for all terms connected to a single post, but only terms that are children to the adoption-status
term
To get all the terms from a specific post, you can make use of wp_get_post_terms()
. This will return all the terms of a specific taxonomy connected to the post.
You will also need to make use of get_term_children()
to get all the child terms from your adoption-status
term
Once you have all that, it is simply to compare the two, and only returning the terms that are associated with the post and is a child term to your given term.
You can try something like the following (NOTE: Change the term ids and taxonomy names accordingly)
$child_terms = get_term_children(21, 'category');
$all_terms = wp_get_post_terms($post->ID, 'category');
foreach ( $all_terms as $term ) {
if( !in_array($term->term_id, $child_terms ) )
continue;
echo $term->name;
}