WC_Helper_Updater::get_update_data()public staticWC 1.0

Get update data for all extensions.

Scans through all subscriptions for the connected user, as well as all Woo extensions without a subscription, and obtains update data for each product.

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

Хуков нет.

Возвращает

Массив. Update data {product_id => data}

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

$result = WC_Helper_Updater::get_update_data();

Код WC_Helper_Updater::get_update_data() WC 9.4.2

public static function get_update_data() {
	$payload = array();

	// Scan subscriptions.
	foreach ( WC_Helper::get_subscriptions() as $subscription ) {
		$payload[ $subscription['product_id'] ] = array(
			'product_id' => $subscription['product_id'],
			'file_id'    => '',
		);
	}

	// Scan local plugins which may or may not have a subscription.
	foreach ( WC_Helper::get_local_woo_plugins() as $data ) {
		if ( ! isset( $payload[ $data['_product_id'] ] ) ) {
			$payload[ $data['_product_id'] ] = array(
				'product_id' => $data['_product_id'],
			);
		}

		$payload[ $data['_product_id'] ]['file_id'] = $data['_file_id'];
	}

	// Scan local themes.
	foreach ( WC_Helper::get_local_woo_themes() as $data ) {
		if ( ! isset( $payload[ $data['_product_id'] ] ) ) {
			$payload[ $data['_product_id'] ] = array(
				'product_id' => $data['_product_id'],
			);
		}

		$payload[ $data['_product_id'] ]['file_id'] = $data['_file_id'];
	}

	return self::_update_check( $payload );
}