tag_escape

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

WordPress Version: 6.1

/**
 * Escapes an HTML tag name.
 *
 * @since 2.5.0
 *
 * @param string $tag_name
 * @return string
 */
function tag_escape($tag_name)
{
    $safe_tag = strtolower(preg_replace('/[^a-zA-Z0-9_:]/', '', $tag_name));
    /**
     * Filters a string cleaned and escaped for output as an HTML tag.
     *
     * @since 2.8.0
     *
     * @param string $safe_tag The tag name after it has been escaped.
     * @param string $tag_name The text before it was escaped.
     */
    return apply_filters('tag_escape', $safe_tag, $tag_name);
}

WordPress Version: 4.6

/**
 * Escape an HTML tag name.
 *
 * @since 2.5.0
 *
 * @param string $tag_name
 * @return string
 */
function tag_escape($tag_name)
{
    $safe_tag = strtolower(preg_replace('/[^a-zA-Z0-9_:]/', '', $tag_name));
    /**
     * Filters a string cleaned and escaped for output as an HTML tag.
     *
     * @since 2.8.0
     *
     * @param string $safe_tag The tag name after it has been escaped.
     * @param string $tag_name The text before it was escaped.
     */
    return apply_filters('tag_escape', $safe_tag, $tag_name);
}

WordPress Version: 3.8

/**
 * Escape an HTML tag name.
 *
 * @since 2.5.0
 *
 * @param string $tag_name
 * @return string
 */
function tag_escape($tag_name)
{
    $safe_tag = strtolower(preg_replace('/[^a-zA-Z0-9_:]/', '', $tag_name));
    /**
     * Filter a string cleaned and escaped for output as an HTML tag.
     *
     * @since 2.8.0
     *
     * @param string $safe_tag The tag name after it has been escaped.
     * @param string $tag_name The text before it was escaped.
     */
    return apply_filters('tag_escape', $safe_tag, $tag_name);
}

WordPress Version: 3.7

/**
 * Escape an HTML tag name.
 *
 * @since 2.5.0
 *
 * @param string $tag_name
 * @return string
 */
function tag_escape($tag_name)
{
    $safe_tag = strtolower(preg_replace('/[^a-zA-Z0-9_:]/', '', $tag_name));
    return apply_filters('tag_escape', $safe_tag, $tag_name);
}