WC_AJAX::define_ajax
Set WC AJAX constant and headers.
Метод класса: WC_AJAX{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$result = WC_AJAX::define_ajax();
Код WC_AJAX::define_ajax() WC AJAX::define ajax WC 9.9.3
public static function define_ajax() { global $wp_query; // phpcs:disable self::set_wc_ajax_argument_in_query(); if ( ! empty( $wp_query->get( 'wc-ajax' ) ) ) { wc_maybe_define_constant( 'DOING_AJAX', true ); wc_maybe_define_constant( 'WC_DOING_AJAX', true ); if ( ! WP_DEBUG || ( WP_DEBUG && ! WP_DEBUG_DISPLAY ) ) { @ini_set( 'display_errors', 0 ); // Turn off display_errors during AJAX events to prevent malformed JSON. } $GLOBALS['wpdb']->hide_errors(); } // phpcs:enable }