Clean way of using ob_start() and ob_end_clean() in wordpress
WordPress has a whole set of useful functions to handle. It’s called wp_send_json(). You have success and error functions too. ob_start(), ob_get_clean() would be useful in case you want to include some views (~ MVC) in your shortcode, e.g in your shortcode handler. I don’t see here why you would use them to pass data … Read more