Automattic\WooCommerce\Admin\Notes

Notes::possibly_delete_survey_notes()public staticWC 1.0

Delete actioned survey notes.

Method of the class: Notes{}

No Hooks.

Return

null. Nothing.

Usage

$result = Notes::possibly_delete_survey_notes();

Notes::possibly_delete_survey_notes() code WC 7.1.0

public static function possibly_delete_survey_notes() {
	$data_store = self::load_data_store();
	$note_ids   = $data_store->get_note_ids_by_type( Note::E_WC_ADMIN_NOTE_SURVEY );

	foreach ( $note_ids as $note_id ) {
		$note = self::get_note( $note_id );
		if ( $note && ( $note->get_status() === Note::E_WC_ADMIN_NOTE_ACTIONED ) ) {
			$note->set_is_deleted( 1 );
			$note->save();
		}
	}
}