Quantcast
Channel: WPRecipes
Viewing all articles
Browse latest Browse all 121

How to allow more HTML tags in WordPress comments

$
0
0

Simply paste the following code in your functions.php file. The list of tags to allow can be modified on line 4.

// Create function which allows more tags within comments
function allow_pres() {
  global $allowedtags;
  $allowedtags['pre'] = array('class'=>array());
}

// Add WordPress hook to use the function
add_action('comment_post', 'allow_pres');

Thanks to David Walsh for the handy tip!


Viewing all articles
Browse latest Browse all 121