WC_Helper_Updater::display_subscription_notice_for_woo_plugins
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.
Method of the class: WC_Helper_Updater{}
No Hooks.
Returns
void. Nothing (null).
Usage
$result = WC_Helper_Updater::display_subscription_notice_for_woo_plugins( $plugin_file, $plugin_data ): void;
- $plugin_file(string) (required)
- Path to the plugin file relative to the plugins directory.
- $plugin_data(array) (required)
- An array of plugin metadata.
Changelog
| Since 11.2.0 | Introduced. |
WC_Helper_Updater::display_subscription_notice_for_woo_plugins() WC Helper Updater::display subscription notice for woo plugins code WC 11.2.2
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 );
}