Automattic\WooCommerce\Admin\Notes

Notes::update_note()public staticWC 1.0

Update a note.

Метод класса: Notes{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = Notes::update_note( $note, $requested_updates );
$note(Note) (обязательный)
The note that will be updated.
$requested_updates(массив) (обязательный)
a list of requested updates.

Код Notes::update_note() 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();
	}
}