Retrieve the terms of the taxonomy that are attached to the post.

Signature

get_the_terms( $post, $taxonomy )
post
 (int|object) Post ID or object.
taxonomy
 (string) Taxonomy name.

Return

(array|boolean|WP_Error) Array of term objects on success, false or WP_Error on failure.

Source

function get_the_terms( $post, $taxonomy ) {
	if ( ! $post = get_post( $post ) )
		return false;

	$terms = get_object_term_cache( $post->ID, $taxonomy );
	if ( false === $terms ) {
		$terms = wp_get_object_terms( $post->ID, $taxonomy );
		wp_cache_add($post->ID, $terms, $taxonomy . '_relationships');
	}

	/**
	 * Filter the list of terms attached to the given post.
	 *
	 * @since 3.1.0
	 *
	 * @param array  $terms    List of attached terms.
	 * @param int    $post_id  Post ID.
	 * @param string $taxonomy Name of the taxonomy.
	 */
	$terms = apply_filters( 'get_the_terms', $terms, $post->ID, $taxonomy );

	if ( empty( $terms ) )
		return false;

	return $terms;
}
WP Trac GitHub

Link here