WC_Helper_Updater::display_notice_for_plugins_without_subscription
Runs on in_plugin_update_message-{file-name}, show a message if plugin is without a subscription. Only Woo local plugins are passed to this function.
Метод класса: WC_Helper_Updater{}
Хуков нет.
Возвращает
void..
Использование
$result = WC_Helper_Updater::display_notice_for_plugins_without_subscription( $plugin_data, $response );
- $plugin_data(объект) (обязательный)
- An array of plugin metadata.
- $response(объект) (обязательный)
- An object of metadata about the available plugin update.
Заметки
| Смотрите: setup_message_for_plugins_without_subscription |
Код WC_Helper_Updater::display_notice_for_plugins_without_subscription() WC Helper Updater::display notice for plugins without subscription WC 11.2.1
public static function display_notice_for_plugins_without_subscription( $plugin_data, $response ) {
$product_id = self::get_product_id_from_update_response( $response );
if ( 0 === $product_id || null !== WC_Helper::get_api_error() ) {
return;
}
// An empty list after a failed fetch would be a guess, which the guard above rules out.
if ( ! empty( self::get_subscriptions_for_product( $product_id ) ) ) {
return;
}
self::print_update_row_message(
self::get_purchase_notice( $product_id, self::get_product_page_url_from_update_response( $response ), self::CAMPAIGN_UPDATE_ROW )
);
}