Languages: English • 日本語 (Add your language)
Return a list of allowed tags and attributes for a given context.
This is filtered by the wp_kses_allowed_html hook which provides you with an easy way to change what is allowed html
<?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
.