Allows to write code on your blog using the 'pre' tags


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. //PHP-Code for functions.php
  2.  
  3. function pre_esc_html($content) {
  4. '#(<pre.*?>)(.*?)(< /pre>)#imsu',
  5. '$i',
  6. 'return $i[1].esc_html($i[2]).$i[3];'
  7. ),
  8. $content
  9. );
  10. }
  11.  
  12. add_filter(
  13. 'the_content',
  14. 'pre_esc_html'
  15. );

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.