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
Post a Comment