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

WC_Helper::_helper_subscription_deactivate() private WC 1.0

Deactivate a product subscription.

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

Возвращает

Null. Ничего.

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

$result = WC_Helper::_helper_subscription_deactivate();

Код WC_Helper::_helper_subscription_deactivate() WC 4.5.2

woocommerce/includes/admin/helper/class-wc-helper.php
<?php
private static function _helper_subscription_deactivate() {
	$product_key = isset( $_GET['wc-helper-product-key'] ) ? wc_clean( wp_unslash( $_GET['wc-helper-product-key'] ) ) : '';
	$product_id  = isset( $_GET['wc-helper-product-id'] ) ? absint( $_GET['wc-helper-product-id'] ) : 0;

	if ( empty( $_GET['wc-helper-nonce'] ) || ! wp_verify_nonce( wp_unslash( $_GET['wc-helper-nonce'] ), 'deactivate:' . $product_key ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
		self::log( 'Could not verify nonce in _helper_subscription_deactivate' );
		wp_die( 'Could not verify nonce' );
	}

	$deactivation_response = WC_Helper_API::post(
		'deactivate',
		array(
			'authenticated' => true,
			'body'          => wp_json_encode(
				array(
					'product_key' => $product_key,
				)
			),
		)
	);

	$code        = wp_remote_retrieve_response_code( $deactivation_response );
	$deactivated = 200 === $code;

	if ( $deactivated ) {
		/**
		 * Fires when the Helper activates a product successfully.
		 *
		 * @param int    $product_id Product ID being deactivated.
		 * @param string $product_key Subscription product key.
		 * @param array  $deactivation_response The response object from wp_safe_remote_request().
		 */
		do_action( 'woocommerce_helper_subscription_deactivate_success', $product_id, $product_key, $deactivation_response );
	} else {
		self::log( sprintf( 'Deactivate API call returned a non-200 response code (%d)', $code ) );

		/**
		 * Fires when the Helper fails to activate a product.
		 *
		 * @param int    $product_id Product ID being deactivated.
		 * @param string $product_key Subscription product key.
		 * @param array  $deactivation_response The response object from wp_safe_remote_request().
		 */
		do_action( 'woocommerce_helper_subscription_deactivate_error', $product_id, $product_key, $deactivation_response );
	}

	self::_flush_subscriptions_cache();

	$redirect_uri = add_query_arg(
		array(
			'page'                 => 'wc-addons',
			'section'              => 'helper',
			'filter'               => self::get_current_filter(),
			'wc-helper-status'     => $deactivated ? 'deactivate-success' : 'deactivate-error',
			'wc-helper-product-id' => $product_id,
		),
		admin_url( 'admin.php' )
	);

	wp_safe_redirect( $redirect_uri );
	die();
}