WordPress at Your Fingertips
function is not described

WC_AJAX::wc_ajax_headers() private WC 2.5.0

Send headers for WC Ajax Requests.

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

No Hooks.

Return

null. Nothing.

Usage

$result = WC_AJAX::wc_ajax_headers();

Changelog

Since 2.5.0 Introduced.

Code of WC_AJAX::wc_ajax_headers() WC 5.9.0

private static function wc_ajax_headers() {
	if ( ! headers_sent() ) {
		send_origin_headers();
		send_nosniff_header();
		wc_nocache_headers();
		header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
		header( 'X-Robots-Tag: noindex' );
		status_header( 200 );
	} elseif ( Constants::is_true( 'WP_DEBUG' ) ) {
		headers_sent( $file, $line );
		trigger_error( "wc_ajax_headers cannot set headers - headers already sent by {$file} on line {$line}", E_USER_NOTICE ); // @codingStandardsIgnoreLine
	}
}