PHP Notice Breaks Admin AJAX
-
When WP_DEBUG is set to true the plugin throws PHP notice “Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in /wp-content/plugins/html-cleanup/html-cleanup.php on line 45” which breaks all admin AJAX functionality. Disabling the plugin or changing WP_DEBUG to false makes it work again. The problem code:
function html_cleanup_buffer_end() { ob_end_flush(); }
Wrapping the function with output buffer check fixes this:
function html_cleanup_buffer_end() { if(ob_get_level() !== 0) { ob_end_flush(); } }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘PHP Notice Breaks Admin AJAX’ is closed to new replies.