WC_Extensions_Tracking::track_extensions_page_connection_error()publicWC 1.0

Send a Tracks event when the Extensions page gets a bad response or no response from the WCCOM extensions API.

{} Это метод класса: WC_Extensions_Tracking{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$WC_Extensions_Tracking = new WC_Extensions_Tracking();
$WC_Extensions_Tracking->track_extensions_page_connection_error( $error );
$error(строка)
-
По умолчанию: ''

Код WC_Extensions_Tracking::track_extensions_page_connection_error() WC 6.4.1

public function track_extensions_page_connection_error( string $error = '' ) {
	// phpcs:disable WordPress.Security.NonceVerification.Recommended
	$properties = array(
		'section' => empty( $_REQUEST['section'] ) ? '_featured' : wc_clean( wp_unslash( $_REQUEST['section'] ) ),
	);

	if ( ! empty( $_REQUEST['search'] ) ) {
		$properties['search_term'] = wc_clean( wp_unslash( $_REQUEST['search'] ) );
	}
	// phpcs:enable

	if ( ! empty( $error ) ) {
		$properties['error_data'] = $error;
	}
	WC_Tracks::record_event( 'extensions_view_connection_error', $properties );
}