WordPress at Your Fingertips
function is not described

WC_AJAX::define_ajax() public WC 1.0

Set WC AJAX constant and headers.

{} It's a method of the class: WC_AJAX{}

No Hooks.

Return

null. Nothing.

Usage

$result = WC_AJAX::define_ajax();

Code of WC_AJAX::define_ajax() WC 5.9.0

public static function define_ajax() {
	// phpcs:disable
	if ( ! empty( $_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
}