Automattic\WooCommerce\Admin\Notes
Notes::delete_notes_with_name()
Deletes admin notes with a given name.
Метод класса: Notes{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$result = Notes::delete_notes_with_name( $names );
- $names(строка|массив) (обязательный)
- Name(s) to search for.
Код Notes::delete_notes_with_name() Notes::delete notes with name WC 8.7.0
public static function delete_notes_with_name( $names ) { if ( is_string( $names ) ) { $names = array( $names ); } elseif ( ! is_array( $names ) ) { return; } $data_store = self::load_data_store(); foreach ( $names as $name ) { $note_ids = $data_store->get_notes_with_name( $name ); foreach ( (array) $note_ids as $note_id ) { $note = self::get_note( $note_id ); if ( $note ) { $note->delete(); } } } }