title: Wordpress shortcodes in the wrong place
body: <p>I'm making wordpress plugin and I want to use shortcodes to insert some quite huge code inside post. I got this simple code that simulates my problem</p>
  
  <pre><code>function shortcode_fn( $attributes ) {
      wanted();
      return "unwanted";
  }
  add_shortcode( 'simplenote', 'shortcode_fn');
  
  function wanted(){
      echo "wanted";
  }
  </code></pre>
  
  <p>and post with this content</p>
  
  <pre><code>start
  [simplenote]
  end
  </code></pre>
  
  <p>that gives this result:</p>
  
  <pre><code>wanted
  start
  unwanted
  end
  </code></pre>
  
  <p>and I want it to insert "wanted" text  between start and end.
  I know easiest solution would be to just return "wanted" in wanted(), but I already have all these functions and they're quite huge. Is there a easy solution without writing everything from scratch?</p>
  
  <p>@edit: maybe is there some way to store all echoes from function in string without printing it?</p>