I’m saving the post content into a post meta, and I’d like to retrieve it instead of the original post content so that when I call the_content() the data in the post meta appears not the actual post data.
function test(){
$post_meta = post meta data here ....
echo apply_filters('the_content', '$post_meta');
}
add_filter('the_content', 'test');
I’m getting this error
Fatal error: Maximum function nesting level of '100' reached
The error does make sense, but how can I achieve what I’m trying to do, any ideas?
UPDATE: After much banging my head against the wall, here is the best way I can think of to hook into the_content and use its filter from within the custom callback without falling into an infinite loop.
The answer was surprisingly simple, and I feel silly for not thinking of it before:
I’m sure you’ve found another solution by now, but still, I hope this helps with any issues you might run into in the future.