Automattic\WooCommerce\Internal\Admin\Notes

ExtensionsWithoutSubscription::delete_note_unless_dismissed_or_actioned │ private static │ WC 1.0

Delete the note now that nothing is missing a subscription, unless the merchant already dealt with it.

A dismissed or actioned note is hidden anyway, and keeping it means it stays that way if the extensions come back, for example after deactivating every plugin to find a conflict.

Method of the class: ExtensionsWithoutSubscription{}

No Hooks.

Returns

void. Nothing (null).

Usage

$result = ExtensionsWithoutSubscription::delete_note_unless_dismissed_or_actioned(): void;

ExtensionsWithoutSubscription::delete_note_unless_dismissed_or_actioned() code WC 11.3.0

private static function delete_note_unless_dismissed_or_actioned(): void {
	$note = Notes::get_note_by_name( self::NOTE_NAME );
	if ( ! $note instanceof Note ) {
		return;
	}

	if ( $note->get_is_deleted() || Note::E_WC_ADMIN_NOTE_ACTIONED === $note->get_status() ) {
		return;
	}

	self::possibly_delete_note();
}