Posted By

ignacio on 08/04/11


Tagged

html blog code entities


Versions (?)

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


 / Published in: PHP
 

  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  

You need to login to post a comment.