Assume I have a function that returns
HTML output after it's done processing it:
function parse_html_for_images() {
return '<img src="' . thumbnail_url() . '">';
}
I need to output this string, say, for the thumbnail of a post on a custom built page.
My mind goes to echo parse_html_for_images()
but this feels somewhat weak, hear me out:
echo
to me feels like a "finish everything after this and don't output anything else".
Then I discovered
ob_start
which creates a buffer for me. Which is exactly what my mind thinks "alright, a place where I can hold on to a lot of data, without outputting it before it's done with everything".
But wouldn't it conflict with, say, esc_html_
and the likes?
Any guidelines?