get_the_tag_list

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

WordPress Version: 5.5

/**
 * Retrieves the tags for a post formatted as a string.
 *
 * @since 2.3.0
 *
 * @param string $before  Optional. String to use before the tags. Default empty.
 * @param string $sep     Optional. String to use between the tags. Default empty.
 * @param string $after   Optional. String to use after the tags. Default empty.
 * @param int    $post_id Optional. Post ID. Defaults to the current post ID.
 * @return string|false|WP_Error A list of tags on success, false if there are no terms,
 *                               WP_Error on failure.
 */
function get_the_tag_list($before = '', $sep = '', $after = '', $post_id = 0)
{
    $tag_list = get_the_term_list($post_id, 'post_tag', $before, $sep, $after);
    /**
     * Filters the tags list for a given post.
     *
     * @since 2.3.0
     *
     * @param string $tag_list List of tags.
     * @param string $before   String to use before the tags.
     * @param string $sep      String to use between the tags.
     * @param string $after    String to use after the tags.
     * @param int    $post_id  Post ID.
     */
    return apply_filters('the_tags', $tag_list, $before, $sep, $after, $post_id);
}

WordPress Version: 4.6

/**
 * Retrieve the tags for a post formatted as a string.
 *
 * @since 2.3.0
 *
 * @param string $before Optional. Before tags.
 * @param string $sep Optional. Between tags.
 * @param string $after Optional. After tags.
 * @param int $id Optional. Post ID. Defaults to the current post.
 * @return string|false|WP_Error A list of tags on success, false if there are no terms, WP_Error on failure.
 */
function get_the_tag_list($before = '', $sep = '', $after = '', $id = 0)
{
    /**
     * Filters the tags list for a given post.
     *
     * @since 2.3.0
     *
     * @param string $tag_list List of tags.
     * @param string $before   String to use before tags.
     * @param string $sep      String to use between the tags.
     * @param string $after    String to use after tags.
     * @param int    $id       Post ID.
     */
    return apply_filters('the_tags', get_the_term_list($id, 'post_tag', $before, $sep, $after), $before, $sep, $after, $id);
}

WordPress Version: 4.3

/**
 * Retrieve the tags for a post formatted as a string.
 *
 * @since 2.3.0
 *
 * @param string $before Optional. Before tags.
 * @param string $sep Optional. Between tags.
 * @param string $after Optional. After tags.
 * @param int $id Optional. Post ID. Defaults to the current post.
 * @return string|false|WP_Error A list of tags on success, false if there are no terms, WP_Error on failure.
 */
function get_the_tag_list($before = '', $sep = '', $after = '', $id = 0)
{
    /**
     * Filter the tags list for a given post.
     *
     * @since 2.3.0
     *
     * @param string $tag_list List of tags.
     * @param string $before   String to use before tags.
     * @param string $sep      String to use between the tags.
     * @param string $after    String to use after tags.
     * @param int    $id       Post ID.
     */
    return apply_filters('the_tags', get_the_term_list($id, 'post_tag', $before, $sep, $after), $before, $sep, $after, $id);
}

WordPress Version: 4.0

/**
 * Retrieve the tags for a post formatted as a string.
 *
 * @since 2.3.0
 *
 * @param string $before Optional. Before tags.
 * @param string $sep Optional. Between tags.
 * @param string $after Optional. After tags.
 * @param int $id Optional. Post ID. Defaults to the current post.
 * @return string|bool|WP_Error A list of tags on success, false if there are no terms, WP_Error on failure.
 */
function get_the_tag_list($before = '', $sep = '', $after = '', $id = 0)
{
    /**
     * Filter the tags list for a given post.
     *
     * @since 2.3.0
     *
     * @param string $tag_list List of tags.
     * @param string $before   String to use before tags.
     * @param string $sep      String to use between the tags.
     * @param string $after    String to use after tags.
     * @param int    $id       Post ID.
     */
    return apply_filters('the_tags', get_the_term_list($id, 'post_tag', $before, $sep, $after), $before, $sep, $after, $id);
}

WordPress Version: 3.9

/**
 * Retrieve the tags for a post formatted as a string.
 *
 * @since 2.3.0
 *
 * @param string $before Optional. Before tags.
 * @param string $sep Optional. Between tags.
 * @param string $after Optional. After tags.
 * @param int $id Optional. Post ID. Defaults to the current post.
 * @return string|bool|WP_Error A list of tags on success, false or WP_Error on failure.
 */
function get_the_tag_list($before = '', $sep = '', $after = '', $id = 0)
{
    /**
     * Filter the tags list for a given post.
     *
     * @since 2.3.0
     *
     * @param string $tag_list List of tags.
     * @param string $before   String to use before tags.
     * @param string $sep      String to use between the tags.
     * @param string $after    String to use after tags.
     * @param int    $id       Post ID.
     */
    return apply_filters('the_tags', get_the_term_list($id, 'post_tag', $before, $sep, $after), $before, $sep, $after, $id);
}

WordPress Version: 3.7

/**
 * Retrieve the tags for a post formatted as a string.
 *
 * @since 2.3.0
 * @uses apply_filters() Calls 'the_tags' filter on string list of tags.
 *
 * @param string $before Optional. Before tags.
 * @param string $sep Optional. Between tags.
 * @param string $after Optional. After tags.
 * @param int $id Optional. Post ID. Defaults to the current post.
 * @return string|bool|WP_Error A list of tags on success, false or WP_Error on failure.
 */
function get_the_tag_list($before = '', $sep = '', $after = '', $id = 0)
{
    return apply_filters('the_tags', get_the_term_list($id, 'post_tag', $before, $sep, $after), $before, $sep, $after, $id);
}