Automattic\WooCommerce\Admin\Notes
Notes::delete_notes_with_name()
Deletes admin notes with a given name.
Method of the class: Notes{}
No Hooks.
Return
null
. Nothing (null).
Usage
$result = Notes::delete_notes_with_name( $names );
- $names(string|array) (required)
- Name(s) to search for.
Notes::delete_notes_with_name() Notes::delete notes with name code 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(); } } } }