Automattic\WooCommerce\Admin\Notes

DataStore::delete()publicWC 1.0

Deletes a note from the database.

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

Хуки из метода

Возвращает

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

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

$DataStore = new DataStore();
$DataStore->delete( $note, $args );
$note(Note) (обязательный) (передается по ссылке — &)
Admin note.
$args(массив)
Array of args to pass to the delete method (not used).
По умолчанию: array()

Код DataStore::delete() WC 8.7.0

public function delete( &$note, $args = array() ) {
	$note_id = $note->get_id();
	if ( $note_id ) {
		global $wpdb;
		$wpdb->delete( $wpdb->prefix . 'wc_admin_notes', array( 'note_id' => $note_id ) );
		$wpdb->delete( $wpdb->prefix . 'wc_admin_note_actions', array( 'note_id' => $note_id ) );
		$note->set_id( null );
	}

	/**
	 * Fires when an admin note is deleted.
	 *
	 * @param int $note_id Note ID.
	 */
	do_action( 'woocommerce_note_deleted', $note_id );
}