Automattic\WooCommerce\Admin\API\Reports

DataStore::add_debug_cache_to_envelope()publicWC 1.0

Add cache debugging information to an enveloped API response.

Метод класса: 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() WC 7.1.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;
}