WC_API_JSON_Handler::get_content_type()publicWC 2.1

Get the content type for the response

Method of the class: WC_API_JSON_Handler{}

No Hooks.

Return

String.

Usage

$WC_API_JSON_Handler = new WC_API_JSON_Handler();
$WC_API_JSON_Handler->get_content_type();

Changelog

Since 2.1 Introduced.

WC_API_JSON_Handler::get_content_type() code WC 8.7.0

public function get_content_type() {

	return sprintf( '%s; charset=%s', isset( $_GET['_jsonp'] ) ? 'application/javascript' : 'application/json', get_option( 'blog_charset' ) );
}