Hide SQL errors during ajax requests

Avoids invalid JSON
This commit is contained in:
Mike Jolley 2015-11-04 13:35:32 +00:00
parent 7eb45ba16f
commit 48f8665e2d
1 changed files with 1 additions and 0 deletions

View File

@ -50,6 +50,7 @@ class WC_AJAX {
if ( ! WP_DEBUG || ( WP_DEBUG && ! WP_DEBUG_DISPLAY ) ) {
@ini_set( 'display_errors', 0 );
}
$GLOBALS['wpdb']->hide_errors();
// Send headers like admin-ajax.php
send_origin_headers();
@header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );