protected function send_response_headers() {

		$http_content_type = 'text/plain';

		// Set an HTTP error code if the response type is an error.
		if ( 'error' === $this->response_type ) {
			http_response_code( 500 ); // Internal server error.
		}

		// Set the content type to JSON if the callback response is an array.
		if ( 'json' === $this->response_type ) {
			$http_content_type = 'application/json';
		}

		header( sprintf( 'Content-Type: %s; charset=%s',
			$http_content_type,
			get_option( 'blog_charset' )
		) );
	}
protected function send_response_headers() {

		$http_content_type = 'text/plain';

		// Set an HTTP error code if the response type is an error.
		if ( 'error' === $this->response_type ) {
			http_response_code( 500 ); // Internal server error.
		}

		// Set the content type to JSON if the callback response is an array.
		if ( 'json' === $this->response_type ) {
			$http_content_type = 'application/json';
		}

		header( sprintf( 'Content-Type: %s; charset=%s',
			$http_content_type,
			get_option( 'blog_charset' )
		) );
	}
protected function send_response_headers ( ) { $ http_content_type = 'text/plain' ; // Set an HTTP error code if the response type is an error. if ( 'error' === $ this -> response_type ) { http_response_code ( 500 ) ; // Internal server error. } // Set the content type to JSON if the callback response is an array. if ( 'json' === $ this -> response_type ) { $ http_content_type = 'application/json' ; } header ( sprintf ( 'Content-Type: %s; charset=%s' , $ http_content_type , get_option ( 'blog_charset' ) ) ) ; }
Sends the appropriate HTTP headers for the response type.
Sends the appropriate HTTP headers for the response type .