Automattic\WooCommerce\Admin\API\Reports

DataStore::add_debug_cache_to_envelope()publicWC 1.0

Add cache debugging information to an enveloped API response.

Method of the class: DataStore{}

No Hooks.

Return

Array.

Usage

$DataStore = new DataStore();
$DataStore->add_debug_cache_to_envelope( $envelope, $response );
$envelope(array) (required)
-
$response(\WP_REST_Response) (required)
-

DataStore::add_debug_cache_to_envelope() code WC 8.7.0

public function add_debug_cache_to_envelope( $envelope, $response ) {
	if ( 0 !== strncmp( '/wc-analytics', $response->get_matched_route(), 13 ) ) {
		return $envelope;
	}

	if ( ! empty( $this->debug_cache_data ) ) {
		$envelope['debug_cache'] = $this->debug_cache_data;
	}

	return $envelope;
}