Title: Option for final &#039;echo&#039;?
Last modified: August 31, 2016

---

# Option for final 'echo'?

 *  Resolved [brettv](https://wordpress.org/support/users/brettv/)
 * (@brettv)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/option-for-final-echo/)
 * Would it be possible for you to make the final ‘echo’ of the plugin output an
   option? Or at least, susceptible to a hook override?
 * The function I am referring to is:
 * function wpp_get_mostpopular($args = NULL) { … }
 * which as it’s final act does this:
 * echo do_shortcode( $shortcode );
 * and in order to pre-process the output of your fine plugin, I have to change 
   this line to:
 * return do_shortcode($shortcode);
 * so that my calling function can further manipulate the output *and* most importantly,
   inject the output just where and when I want it – not immediately into the rendered
   output like the “echo” causes.
 * Thanks for the consideration. Fine plugin, appreciate your work.
 * [https://wordpress.org/plugins/wordpress-popular-posts/](https://wordpress.org/plugins/wordpress-popular-posts/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/option-for-final-echo/#post-7125530)
 * Hi there!
 * Why not use either the [wpp_custom_html filter](https://github.com/cabrerahector/wordpress-popular-posts/wiki/3.-Filters#wpp_custom_html)
   or the [wpp_post filter](https://github.com/cabrerahector/wordpress-popular-posts/wiki/3.-Filters#wpp_post)
   instead?
 *  Thread Starter [brettv](https://wordpress.org/support/users/brettv/)
 * (@brettv)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/option-for-final-echo/#post-7125544)
 * Thanks for replying.
 * I am already using the wpp_custom_html filter to customize the output, that was
   a thoughtful include on your part.
 * The only issue regarding the “echo” return of the data is that the way I have
   used your plugin is that I needed to capture it’s output in order to feed it 
   upstream to other page assembly mechanisms. In other words, I need the output
   from the WPP, but quietly, as all the page contents are not yet finished – more“
   partials” or “dynamic views” are being computed.
 * Now, it has been a number of months since I did the integration, and I would 
   be happy to look at doing it another way. Is there another way to trigger the
   functionality of WPP (which would include using the wpp_custom_html filter hook–
   which was a nice time saver) that did not immediately “echo” it’s output into
   the render chain?
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/option-for-final-echo/#post-7125551)
 * Well, the only thing I can think of right now that wouldn’t require touching 
   WPP’s code directly is [this](http://philsmart.me/wordpress-popular-posts-plugin-raw-data-array/)
   combined with some AJAX – the downside is that you’d need to adjust the code 
   to build the HTML output before returning it.
 *  Thread Starter [brettv](https://wordpress.org/support/users/brettv/)
 * (@brettv)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/option-for-final-echo/#post-7125556)
 * Good find from Phil Smart, that is pretty much exactly the issue, and a nice 
   way of solving it without hacking on the module itself. Thanks.
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/option-for-final-echo/#post-7125559)
 * Don’t mention it 🙂

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Option for final 'echo'?’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-popular-posts/assets/icon-256x256.png?rev=1232659)
 * [WP Popular Posts](https://wordpress.org/plugins/wordpress-popular-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-popular-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-popular-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-popular-posts/reviews/)

## Tags

 * [filter](https://wordpress.org/support/topic-tag/filter/)
 * [hook](https://wordpress.org/support/topic-tag/hook/)
 * [wpp_custom_html](https://wordpress.org/support/topic-tag/wpp_custom_html/)
 * [wpp_post](https://wordpress.org/support/topic-tag/wpp_post/)

 * 5 replies
 * 2 participants
 * Last reply from: [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/option-for-final-echo/#post-7125559)
 * Status: resolved