diff --git a/gc-google-sheets/gcgs-gppa-custom-query-builder-args.php b/gc-google-sheets/gcgs-gppa-custom-query-builder-args.php new file mode 100644 index 000000000..5cb05b28e --- /dev/null +++ b/gc-google-sheets/gcgs-gppa-custom-query-builder-args.php @@ -0,0 +1,42 @@ +get_column_letter( $args['primary_property_value'], $property_id ); + + if ( ! empty( $filter_value ) ) { + $conditions = array(); + // Loop over the $value array and create conditions. + foreach ( $filter_value as $v ) { + if ( ! empty( $v ) ) { + $conditions[] = sprintf( "lower(%s) = '%s'", $column_letter, strtolower( $v ) ); + } + } + + // Implode the conditions array with ' OR ' to form the $clause. + $query_builder_args['where'][ $filter_group_index ][ $filter_group_index ] = implode( ' OR ', $conditions ); + } + + return $query_builder_args; +}, 10, 3);