Automattic\WooCommerce\Admin\Notes

Notes::update_note()public staticWC 1.0

Update a note.

Method of the class: Notes{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = Notes::update_note( $note, $requested_updates );
$note(Note) (required)
The note that will be updated.
$requested_updates(array) (required)
a list of requested updates.

Notes::update_note() code WC 8.7.0

public static function update_note( $note, $requested_updates ) {
	$note_changed = false;
	if ( isset( $requested_updates['status'] ) ) {
		$note->set_status( $requested_updates['status'] );
		$note_changed = true;
	}

	if ( isset( $requested_updates['date_reminder'] ) ) {
		$note->set_date_reminder( $requested_updates['date_reminder'] );
		$note_changed = true;
	}

	if ( isset( $requested_updates['is_deleted'] ) ) {
		$note->set_is_deleted( $requested_updates['is_deleted'] );
		$note_changed = true;
	}

	if ( isset( $requested_updates['is_read'] ) ) {
		$note->set_is_read( $requested_updates['is_read'] );
		$note_changed = true;
	}

	if ( $note_changed ) {
		$note->save();
	}
}