Do we have In_category like function for tags?

Here is the source of in_category function:

function in_category( $category, $post = null ) {
    if ( empty( $category ) )
        return false;

    return has_term( $category, 'category', $post );
}

You see, it’s actually has_term. This is the same as has_category function.

For tags, there’s no in_tag function, but you can use has_tag. It has the same functionality:

has_tag( $tag, $post );

Or you can use:

has_term( $tag, 'post_tag', $post );

where $post can be omitted (default is current post).

They’re all the same!

error code: 523