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

WC_Helper_Updater::_has_active_subscription() private WC 1.0

Check for an active subscription.

Checks a given product id against all subscriptions on the current site. Returns true if at least one active subscription is found.

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

Хуков нет.

Возвращает

true/false. True if active subscription found.

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

$result = WC_Helper_Updater::_has_active_subscription( $product_id );
$product_id(число) (обязательный)
The product id to look for.

Код WC_Helper_Updater::_has_active_subscription() WC 4.5.2

woocommerce/includes/admin/helper/class-wc-helper-updater.php
<?php
private static function _has_active_subscription( $product_id ) {
	if ( ! isset( $auth ) ) {
		$auth = WC_Helper_Options::get( 'auth' );
	}

	if ( ! isset( $subscriptions ) ) {
		$subscriptions = WC_Helper::get_subscriptions();
	}

	if ( empty( $auth['site_id'] ) || empty( $subscriptions ) ) {
		return false;
	}

	// Check for an active subscription.
	foreach ( $subscriptions as $subscription ) {
		if ( $subscription['product_id'] != $product_id ) {
			continue;
		}

		if ( in_array( absint( $auth['site_id'] ), $subscription['connections'] ) ) {
			return true;
		}
	}

	return false;
}