Codex tools: Log in
Contents |
Return a list of allowed tags and attributes for a given context.
<?php $allowed_tags = wp_kses_allowed_html( $context ); ?>
Returns the list of allowed HTML tags for a given context. The Return value is a multidimensional array with the tag name as the key and an array of attributes as the value.
<?php
$allowed_tags = wp_kses_allowed_html( 'post' );
var_dump( $allowed_tags );
/*
array(74) {
['address']=>
array(4) {
['class']=>
bool(true)
['id']=>
bool(true)
['style']=>
bool(true)
['title']=>
bool(true)
}
...
['var']=>
array(4) {
['class']=>
bool(true)
['id']=>
bool(true)
['style']=>
bool(true)
['title']=>
bool(true)
}
}
*/
wp_kses_allowed_html() is located in wp-includes/kses.php.