title: Apply filter to WordPress shortcode output
body: <p>I would like to modify the shortcode output of a WordPress plugin.</p>
  
  <p>I have tried the following:</p>
  
  <pre><code>$myShortcode = do_shortcode('[print_responsive_thumbnail_slider id="1"]');
  echo apply_filters('new_shortcode_filter',$myShortcode);
  
  
  add_filter('new_shortcode_filter','new_shortcode_filter_callback');
  
  function new_shortcode_filter_callback($myShortcode){
      //modify content right here
  
      return $modifiedContent;
  }
  </code></pre>
  
  <p>Unfortunately the filter isn't applied on the shortcode output.</p>
  
  <p>If I do it like this to override the shortcode and to modifiy the output there will be a infinite loop caused by the do_shortcode function:</p>
  
  <pre><code>function update_shortcode_slider_content() {
      $sliderContent = do_shortcode('[print_responsive_thumbnail_slider id="1"]');;
      //some magic
  
      return $modifiedSliderContent;
  }
  add_shortcode('print_responsive_thumbnail_slider', 'update_shortcode_slider_content');
  </code></pre>
  
  <p>Did I do something wrong or is there another/better way to modify the output of a shortcode?</p>