WC_Helper_Updater::display_subscription_notice_for_woo_plugins │ public static │ WC 11.2.0

Runs on after_plugin_row, show a subscription message on WooCommerce.com plugin rows that Core renders no update notice for.

Rows that do have an update are covered by the in_plugin_update_message-{file-name} handlers. Without one, a plugin whose subscription is missing, expired, or lapsing says nothing at all.

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

Хуков нет.

Возвращает

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

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

$result = WC_Helper_Updater::display_subscription_notice_for_woo_plugins( $plugin_file, $plugin_data ): void;
$plugin_file(строка) (обязательный)
Path to the plugin file relative to the plugins directory.
$plugin_data(массив) (обязательный)
An array of plugin metadata.

Список изменений

С версии 11.2.0 Введена.

Код WC_Helper_Updater::display_subscription_notice_for_woo_plugins() WC 11.2.1

public static function display_subscription_notice_for_woo_plugins( $plugin_file, $plugin_data ): void {
	$product_id = self::get_product_id_for_plugin_row_notice( $plugin_file, $plugin_data );
	if ( 0 === $product_id ) {
		return;
	}

	$notice = self::get_subscription_notice( $product_id, self::get_product_page_url( $plugin_file ), self::CAMPAIGN_PLUGIN_ROW );
	if ( '' === $notice ) {
		return;
	}

	self::print_plugin_row_notice( $plugin_file, 'woo-subscription-notice', $notice );
}