<?php

function jchwebdev_pullquote( $content ) {
    $pattern = "~\[callout\](.*?)\[/callout\]~s";
    if(preg_match($pattern, $content, $matches))
    {
      $content = preg_replace($pattern, '$1', $content);
      $pullquote = '<blockquote class="pullquote">' .$matches[1] . '</blockquote>';
      $content = preg_replace("@(.*?</p>){3}\K@s", $pullquote, $content);
      return $content;
    }
    return $content;    
}

$text = <<<EOT
<p>If you wanna improve yer German, don't try to read Heine or some elevated crap... watch old episodes of [callout]Tatort or Bukow & Konig[/callout].</p>
<p>If I were teaching a music appreciation I wouldn't teach Beethoven. I'd teach Stamitz and average composers.</p>
<p>And here is a 3rd paragraph.</p>
<p>And here is a 4th paragraph.</p>
EOT;

echo jchwebdev_pullquote($text);
