IAM

OPENSOURCEFAN STUDYING
STUDYINGCOMPUTERSCIENCEANDMATH COMPUTERSCIENCE

Check out the latest superpixel benchmark — Superpixel Benchmark (2016) — and let me know your opinion! @david_stutz
14thFEBRUARY2017

SNIPPET

Some lines in functions.php allowing to avoid HTML entities in between pre tags in Wordpress. This is especially useful when using syntax highlighting tools or plugins.

functions.php
// http://wordpress.stackexchange.com/questions/91720/replace-html-entities-in-posts-between-pre-tags
add_filter('the_content', 'iamdavidstutz_pre_filter', 0);

/**
 * Replace content of pre tags with htmlentities.
 */
function iamdavidstutz_pre_filter($content) {
    return preg_replace_callback('|<pre.*>(.*)                                

What is your opinion on the code snippet? Is it working? Let me know your thoughts in the comments below or using the following platforms: