Automattic\WooCommerce\Internal\Admin\Settings
Payments::dismiss_extension_suggestion_incentive
Dismiss a payment extension suggestion incentive.
Метод класса: Payments{}
Хуков нет.
Возвращает
true|false. True if the incentive was not previously dismissed and now it is. False if the incentive was already dismissed or could not be dismissed.
Использование
$Payments = new Payments(); $Payments->dismiss_extension_suggestion_incentive( $suggestion_id, $incentive_id, $context, $do_not_track ): bool;
- $suggestion_id(строка) (обязательный)
- The suggestion ID.
- $incentive_id(строка) (обязательный)
- The incentive ID.
- $context(строка)
- The context in which the incentive should be dismissed.
По умолчанию:to dismiss the incentive in all contexts - $do_not_track(true|false)
- If true, the incentive dismissal will not be tracked.
По умолчанию:false
Код Payments::dismiss_extension_suggestion_incentive() Payments::dismiss extension suggestion incentive WC 10.4.3
public function dismiss_extension_suggestion_incentive( string $suggestion_id, string $incentive_id, string $context = 'all', bool $do_not_track = false ): bool {
$result = $this->extension_suggestions->dismiss_incentive( $incentive_id, $suggestion_id, $context );
if ( ! $do_not_track && $result ) {
// Record an event that the incentive was dismissed.
$this->record_event(
'incentive_dismiss',
array(
'suggestion_id' => $suggestion_id,
'incentive_id' => $incentive_id,
'display_context' => $context,
)
);
}
return $result;
}