WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WC_Webhook::deliver() WC 2.2.0

Deliver the webhook payload using wp_safe_remote_request().

Это метод класса: WC_Webhook

Хуки из метода
Возвращает

Ничего (null).

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

$WC_Webhook = new WC_Webhook();
$var = $WC_Webhook->deliver( $arg );
$arg(смешанный) (обязательный)
First hook argument.

Код WC Webhook::deliver: woocommerce/includes/class-wc-webhook.php WC 3.6.3

<?php
public function deliver( $arg ) {
	$start_time = microtime( true );
	$payload    = $this->build_payload( $arg );

	// Setup request args.
	$http_args = array(
		'method'      => 'POST',
		'timeout'     => MINUTE_IN_SECONDS,
		'redirection' => 0,
		'httpversion' => '1.0',
		'blocking'    => true,
		'user-agent'  => sprintf( 'WooCommerce/%s Hookshot (WordPress/%s)', WC_VERSION, $GLOBALS['wp_version'] ),
		'body'        => trim( wp_json_encode( $payload ) ),
		'headers'     => array(
			'Content-Type' => 'application/json',
		),
		'cookies'     => array(),
	);

	$http_args = apply_filters( 'woocommerce_webhook_http_args', $http_args, $arg, $this->get_id() );

	// Add custom headers.
	$delivery_id                                      = $this->get_new_delivery_id();
	$http_args['headers']['X-WC-Webhook-Source']      = home_url( '/' ); // Since 2.6.0.
	$http_args['headers']['X-WC-Webhook-Topic']       = $this->get_topic();
	$http_args['headers']['X-WC-Webhook-Resource']    = $this->get_resource();
	$http_args['headers']['X-WC-Webhook-Event']       = $this->get_event();
	$http_args['headers']['X-WC-Webhook-Signature']   = $this->generate_signature( $http_args['body'] );
	$http_args['headers']['X-WC-Webhook-ID']          = $this->get_id();
	$http_args['headers']['X-WC-Webhook-Delivery-ID'] = $delivery_id;

	// Webhook away!
	$response = wp_safe_remote_request( $this->get_delivery_url(), $http_args );

	$duration = round( microtime( true ) - $start_time, 5 );

	$this->log_delivery( $delivery_id, $http_args, $response, $duration );

	do_action( 'woocommerce_webhook_delivery', $http_args, $response, $duration, $arg, $this->get_id() );
}