Automattic\WooCommerce\Internal\OrderWithdrawal
OrderWithdrawalFeatureHighlightNotification::dismiss_note
Dismiss notes with the given name.
Method of the class: OrderWithdrawalFeatureHighlightNotification{}
No Hooks.
Returns
null. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->dismiss_note( $note_name ): void;
- $note_name(string) (required)
- Note name stored in the data store.
OrderWithdrawalFeatureHighlightNotification::dismiss_note() OrderWithdrawalFeatureHighlightNotification::dismiss note code WC 11.3.0
private function dismiss_note( string $note_name ): void {
/**
* Data store instance.
*
* @var NotesDataStore $data_store
*/
$data_store = Notes::load_data_store();
$note_ids = $data_store->get_notes_with_name( $note_name );
foreach ( $note_ids as $note_id ) {
$note = Notes::get_note( $note_id );
if ( ! $note instanceof Note || Note::E_WC_ADMIN_NOTE_ACTIONED === $note->get_status() ) {
continue;
}
$note->set_status( Note::E_WC_ADMIN_NOTE_ACTIONED );
$note->save();
}
}