So I know you can use output buffer. The problem right now is, I am using a function in a WordPress plugin and it is automatically and it automatically outputs the return. However, I want to check the return to see if it is false or returning my data.
I have tried:
if( function_name() ) {
}
$name = function_name();
I can still see the output in those situations, which I why I wanted to suppress it and do some checks first. I don’t want to edit the core function of the plugin, but I will as a last resort. Is there a better work around?
Yes. It can be done like this:
Have a look here for more information about output control functions.
Also, instead of using
ob_flushandob_end_cleanyou could useob_get_clean.