How to get WordPress term attached to the Post?

There’s a function specifically for this, it’s called wp_get_post_terms().

Unfortunately, you do need to care about the taxonomy. If you don’t specify a taxonomy, it will return all of the “post_tags” terms:

$terms = wp_get_post_terms( $post_id, $taxonomy, $args )
  • $post_id is the ID of the post you’re working with (defaults to 0)
  • $taxonomy is the name of the taxonomy for which you want to retrieve terms (defaults to “post_tags”
  • $args is an array of overrides of other default parameters (see the Codex for details)