the_tags

The timeline below displays how wordpress function the_tags has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.5

/**
 * Displays the tags for a post.
 *
 * @since 2.3.0
 *
 * @param string $before Optional. String to use before the tags. Defaults to 'Tags:'.
 * @param string $sep    Optional. String to use between the tags. Default ', '.
 * @param string $after  Optional. String to use after the tags. Default empty.
 */
function the_tags($before = null, $sep = ', ', $after = '')
{
    if (null === $before) {
        $before = __('Tags: ');
    }
    $the_tags = get_the_tag_list($before, $sep, $after);
    if (!is_wp_error($the_tags)) {
        echo $the_tags;
    }
}

WordPress Version: 4.7

/**
 * Retrieve the tags for a post.
 *
 * @since 2.3.0
 *
 * @param string $before Optional. Before list.
 * @param string $sep Optional. Separate items using this.
 * @param string $after Optional. After list.
 */
function the_tags($before = null, $sep = ', ', $after = '')
{
    if (null === $before) {
        $before = __('Tags: ');
    }
    $the_tags = get_the_tag_list($before, $sep, $after);
    if (!is_wp_error($the_tags)) {
        echo $the_tags;
    }
}

WordPress Version: 3.7

/**
 * Retrieve the tags for a post.
 *
 * @since 2.3.0
 *
 * @param string $before Optional. Before list.
 * @param string $sep Optional. Separate items using this.
 * @param string $after Optional. After list.
 */
function the_tags($before = null, $sep = ', ', $after = '')
{
    if (null === $before) {
        $before = __('Tags: ');
    }
    echo get_the_tag_list($before, $sep, $after);
}