Automattic\WooCommerce\Internal\Admin\Settings

Payments::dismiss_extension_suggestion_incentivepublicWC 1.0

Dismiss a payment extension suggestion incentive.

Method of the class: Payments{}

No Hooks.

Returns

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.

Usage

$Payments = new Payments();
$Payments->dismiss_extension_suggestion_incentive( $suggestion_id, $incentive_id, $context, $do_not_track ): bool;
$suggestion_id(string) (required)
The suggestion ID.
$incentive_id(string) (required)
The incentive ID.
$context(string)
The context in which the incentive should be dismissed.
Default: to dismiss the incentive in all contexts
$do_not_track(true|false)
If true, the incentive dismissal will not be tracked.
Default: false

Payments::dismiss_extension_suggestion_incentive() code WC 9.9.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;
}