$where_clauses .= " AND name IN ($escaped_where_names)";
if ( ! empty( $escaped_where_excluded_names ) ) {
$where_clauses .= " AND name NOT IN ($escaped_where_excluded_names)";
if ( ! empty( $escaped_where_source ) ) {
$where_clauses .= " AND source IN ($escaped_where_source)";
if ( isset( $args['is_read'] ) ) {
$where_clauses .= $args['is_read'] ? ' AND is_read = 1' : ' AND is_read = 0';
$where_clauses .= $escaped_is_deleted ? ' AND is_deleted = 1' : ' AND is_deleted = 0';
* Find all the notes with a given name.
* @param string $name Name to search for.
* @return array An array of matching note ids.
public function get_notes_with_name( $name ) {
"SELECT note_id FROM {$wpdb->prefix}wc_admin_notes WHERE name = %s ORDER BY note_id ASC",
* Find the ids of all notes with a given type.
* @param string $note_type Type to search for.
* @return array An array of matching note ids.
public function get_note_ids_by_type( $note_type ) {
"SELECT note_id FROM {$wpdb->prefix}wc_admin_notes WHERE type = %s ORDER BY note_id ASC",