function truethemes_formatter($content) { $new_content = ''; $pattern_full = '{(\[raw\].*?\[/raw\])}is'; $pattern_contents = '{\[raw\](.*?)\[/raw\]}is'; $pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE); foreach ($pieces as $piece) { if (preg_match($pattern_contents, $piece, $matches)) { $new_content .= $matches[1]; } else { //@since 4.0.3 - search for rev_slider in content, if found, do not wpautop if(stripos($piece,"rev_slider") !== false){ $new_content .= $piece; //this detects the vc front end editor,if found, do not wpautop, or it will break! }elseif(stripos($piece,"vc_element")!==false){ $new_content .= $piece; }elseif(stripos($piece,"wpdreams_")!==false){ $new_content .= $piece; //this detects karma builder plugin, and the span class tt-blog-placeholder,if found, do not wpautop, or it will break! }elseif(function_exists('karma_builder_load_textdomain') && stripos($piece,"tt-blog-placeholder")!==false){ $new_content .= $piece; }else{ //in normal content, we do auto p tags. $new_content .= wptexturize(wpautop($piece)); //$new_content .= $piece; //<-- uncomment and delete line above to disable wpautop } } } return $new_content; }