WordPress at Your Fingertips
function is not described

WC_AJAX::do_wc_ajax() public WC 1.0

Check for WC Ajax request and fire action.

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

Hooks from the method

Return

null. Nothing.

Usage

$result = WC_AJAX::do_wc_ajax();

Code of WC_AJAX::do_wc_ajax() WC 5.9.0

public static function do_wc_ajax() {
	global $wp_query;

	// phpcs:disable WordPress.Security.NonceVerification.Recommended
	if ( ! empty( $_GET['wc-ajax'] ) ) {
		$wp_query->set( 'wc-ajax', sanitize_text_field( wp_unslash( $_GET['wc-ajax'] ) ) );
	}

	$action = $wp_query->get( 'wc-ajax' );

	if ( $action ) {
		self::wc_ajax_headers();
		$action = sanitize_text_field( $action );
		do_action( 'wc_ajax_' . $action );
		wp_die();
	}
	// phpcs:enable
}