ob_get_clean returns empty string, ob_get_flush outputs string

The reason my code was failing was due to it reaching a memory limit.

I was adding a filter to the_content, and was calling another plugin’s API (Custom Field Suite) to get some meta data that was of the WYSIWYG type. This type of field runs through the_content filter, so I was hitting an infinite loop.

I couldn’t find this out on WP Engine because they have very limited error logging.

I ended up testing the site on a MediaTemple server, which resulted in the correct error message being displayed.

To fix this, I removed the filter from the_content BEFORE I called the meta data getter, then added it back after.

Leave a Comment