Automattic\WooCommerce\Admin\Notes
Notes::update_note() public WC 1.0
Update a note.
{} Это метод класса: Notes{}
Хуков нет.
Возвращает
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() Notes::update note WC 5.0.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 ( $note_changed ) {
$note->save();
}
}