Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have been going crazy trying to google up what these globals are. What are allowedposttags and allowedtags? What is the difference between the two? Is there a list of all WP Globals and an explanation of what they are?

For MCE Editor - to allow users not logged in to use lists and underline + strikethrough add following:

add_action('init', 'my_html_tags_code', 10);
function my_html_tags_code() {
  global $allowedposttags, $allowedtags;
    //$allowedposttags["ol"] = array();
    //$allowedposttags["ul"] = array();
    $allowedtags["ol"] = array();
    $allowedtags["ul"] = array();
    $allowedtags["li"] = array();
    $allowedtags["span"] = array( "style" => array() );
}
share|improve this question

1 Answer 1

up vote 4 down vote accepted

These are arrays that are used by the wp_kses library. Basically they are white lists of html tags and attributes that WordPress allows in posts and comments. If memory serves correctly, "allowedposttags" is used for sanitizing post_content while "allowedtags" is used for comments.

share|improve this answer
    
Thanks for getting me started. From what I see allowedposttags are tags allowed for logged in users. allowedtags are for not logged in users. This also applies to comments and what was driving me crazy. If you are logged in tags probably wont get stripped. But if not then probably will. –  mrtsherman May 12 '11 at 19:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.