• Resolved tactics

    (@tactics)


    OK, I’ve searched everywhere and can’t seem to find any information on how to set which HTML tags are allowed in comments. Does that option not exist in 2.7?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    The allowed_tags option has been deprecated for a while, and got removed in 2.7. You can define what tags you want to allow in a plugin though. Look at the top of the kses.php file and see the $allowedpostags and $allowedtags globals. To redefine them, you’d do something like this:

    define('CUSTOM_TAGS', true);
    global $allowedposttags, $allowedtags;
    $allowedposttags = array(
    		'address' => array(),
    ... blah ...
    );
    $allowedtags = array(
    		'a' => array(
    ... blah ...
    );

    Alternatively, your plugin could hook to the init action and then change these variables there instead of defining them all.

    Thread Starter tactics

    (@tactics)

    Aha. Well, it still exists in the default theme, it’s just commented out. So I was under the impression that this meant HTML tags were simply disabled by default, and uncommenting that line enabled them. I’ll start chopping up the kses file. Thanks a bunch.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Ahh.. Err, okay, maybe we’re not talking about the same things.

    Uncomenting that line in the default theme makes it show the user what tags are allowed and what tags are not allowed.

    The default set of allowedtags is in kses.php like I said before. But I thought you wanted to modify which tags were allowed, not just show the user which tags were allowed.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Where the hell is the allowed_tags setting in 2.7?’ is closed to new replies.