Query Order By with Meta Key is not using fallback by default with frontend rendering


When using filters to sort a query, we are specifying fallback’s for the default behaviour when no filter has been selected.

These are not applying and the default sort is being used.

Step-by-step reproduction instructions:

  1. Open the Post Editor/Site Editor
  2. Create a Posts Query
  3. Add filters including a field for the meta key (e.g. “orderby”) and a field for the sort direction (e.g. “direction”)
  4. Specify the fallback’s for each of these
  5. Note they are not applied by default when no filter has been explicitly selected

Screenshots, screen recording, code snippet

Environment info

  • WordPress version: 6.3.1
  • Cwicly Plugin version:

@Araminta To help replicate the issue, I am sending you a live example of this.

1 Like

@Louis, just checking on the status of this as the current workaround for it is fragile and clunky and only practical short-term, so we will be really grateful when this is working correctly.