Shortcode AutoP Savior

function ter_shortcode_content_filter($content){
$block = join('|',array('one-third','grid'));
$rep = preg_replace("/(<p>)?[($block)(s[^]]+)?](</p>|<br />)?/","[$2$3]",$content);
$rep = preg_replace("/(<p>)?[/($block)](</p>|<br />)?/","[/$2]",$rep);
return $rep;
}
add_filter('the_content','ter_shortcode_content_filter');

0 Comments

You must be logged in to post a comment.