Add server row sorting, filtering, and search#178
Merged
Conversation
371c6c3 to
c09db2e
Compare
c09db2e to
0933ac6
Compare
The controller was juggling a token, three side-channel query vars (cortext_rows_where, cortext_rows_sort, cortext_rows_join) and two inline closures to install scoped posts_where/posts_clauses filters around its WP_Query call. RowsQueryScope owns all of that now: the controller hands it the SQL fragments and the sort, and gets a WP_Query back. Token still exists, hidden inside the scope; the other query vars are gone because the closures capture the data directly. build_query_args goes back to a clean signature with no SQL params.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes #102.
Moves common collection row queries onto
GET /cortext/v1/rows: sorting, field filters, grouped filters, and split-term search. The server now handles the field types we can query reliably, while unsupported query shapes stay on the client instead of being silently sent to the endpoint.Why
The table already fetched rows from the rows endpoint, but search and richer filters still depended on client-side behavior. This adds server query support for the normal database-table cases without taking on server pagination changes in this PR.
How
Server-supported fields:
RowsFilterQueryand a smallWP_Meta_Queryextension for comparison shapes WP core does not support yet.Testing Instructions
Screen recording
Grabacion.de.pantalla.2026-05-13.a.las.16.57.16.mov