allowed_tags()
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.
1 time — 0.00004 sec (very fast) | 50000 times — 0.69 sec (very fast) | PHP 7.0.5, WP 4.5.1
No Hooks.
Return
String
. HTML allowed tags entity encoded.
Usage
allowed_tags();
Notes
- Global. Array. $allowedtags
Changelog
Since 1.0.1 | Introduced. |
Code of allowed_tags() allowed tags WP 5.9.3
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 ); }