php - Filtering the $allowedtags global in WordPress -


i'm trying filter $allowedtags global in wordpress users can submit html elements in comments.

this how i'm doing it:

function my_allowed_tags() {     global $allowedtags;     $allowedtags['pre'] = array( 'style' => array() ); } add_action( 'init', 'my_allowed_tags' ); 

this allows use of <pre> tags in comments along default list of tags allowed $allowedtags such <p>, <a>, <img> etc.

how can initialise $allowedtags global no tags allowed default?

ref: http://codex.wordpress.org/global_variables#admin_globals

add filter resets global empty array before current action fires.

function reset_allowed_tags() {     global $allowedtags;     $allowedtags = array(); } add_action('init', 'reset_allowed_tags', 0); 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -