allowed_tags

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

WordPress Version: 6.1

/**
 * Displays all of the allowed tags in HTML format with attributes.
 *
 * This is useful for displaying in the comment area, which elements and
 * attributes are supported. As well as any plugins which want to display it.
 *
 * @since 1.0.1
 * @since 4.4.0 No longer used in core.
 *
 * @global array $allowedtags
 *
 * @return string HTML allowed tags entity encoded.
 */
function allowed_tags()
{
    global $allowedtags;
    $allowed = '';
    foreach ((array) $allowedtags as $tag => $attributes) {
        $allowed .= '<' . $tag;
        if (0 < count($attributes)) {
            foreach ($attributes as $attribute => $limits) {
                $allowed .= ' ' . $attribute . '=""';
            }
        }
        $allowed .= '> ';
    }
    return htmlentities($allowed);
}

WordPress Version: 4.3

/**
 * Display all of the allowed tags in HTML format with attributes.
 *
 * This is useful for displaying in the comment area, which elements and
 * attributes are supported. As well as any plugins which want to display it.
 *
 * @since 1.0.1
 *
 * @global array $allowedtags
 *
 * @return string HTML allowed tags entity encoded.
 */
function allowed_tags()
{
    global $allowedtags;
    $allowed = '';
    foreach ((array) $allowedtags as $tag => $attributes) {
        $allowed .= '<' . $tag;
        if (0 < count($attributes)) {
            foreach ($attributes as $attribute => $limits) {
                $allowed .= ' ' . $attribute . '=""';
            }
        }
        $allowed .= '> ';
    }
    return htmlentities($allowed);
}

WordPress Version: 3.7

/**
 * Display all of the allowed tags in HTML format with attributes.
 *
 * This is useful for displaying in the comment area, which elements and
 * attributes are supported. As well as any plugins which want to display it.
 *
 * @since 1.0.1
 * @uses $allowedtags
 *
 * @return string HTML allowed tags entity encoded.
 */
function allowed_tags()
{
    global $allowedtags;
    $allowed = '';
    foreach ((array) $allowedtags as $tag => $attributes) {
        $allowed .= '<' . $tag;
        if (0 < count($attributes)) {
            foreach ($attributes as $attribute => $limits) {
                $allowed .= ' ' . $attribute . '=""';
            }
        }
        $allowed .= '> ';
    }
    return htmlentities($allowed);
}