OK finally found the solution.
After looking in wp_term_taxonomy
table, I noticed that taxonomy
column describes the taxonomy term for tags – which is actually post_tag
, not just ‘tag’.
So, this works:
add_filter('rest_prepare_post_tag', 'wp_api_encode_yoast', 10, 3);
Hopefully someone will be helped by this.