WC_Tracker::record_send_result │ private static │ WC 1.0

Record the outcome of a delivery attempt.

The send time is recorded after acceptance or permanent abandonment. A transient failure remains pending for the next run.

Метод класса: WC_Tracker{}

Хуков нет.

Возвращает

null. Ничего (null).

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

$result = WC_Tracker::record_send_result( $response, $body_bytes ): void;
$response(массив|WP_Error) (обязательный)
Response from wp_safe_remote_post().
$body_bytes(int) (обязательный)
Size of the posted snapshot.

Код WC_Tracker::record_send_result() WC 11.3.0

private static function record_send_result( $response, $body_bytes ): void {
	$status = is_wp_error( $response ) ? 0 : (int) wp_remote_retrieve_response_code( $response );

	if ( 200 <= $status && 300 > $status ) {
		self::finish_snapshot();
		return;
	}

	self::record_send_failure( self::is_retryable_status( $status ), $status, is_wp_error( $response ) ? (string) $response->get_error_code() : '', $body_bytes );
}