Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #59226, comment 9


Ignore:
Timestamp:
08/29/2023 04:29:56 PM (22 months ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #59226, comment 9

    initial v1  
    44> I think we'll need to add "translation layer" logic into `get_pages()`, to ensure that all the orderby values which were supported by `get_pages()` but aren't supported by `WP_Query` are properly translated (`post_modified_gmt` is not the only one as far as I can tell).
    55
    6 Yep, a "translation layer" would probably work. But wouldn't adding that layer basically mean the old code is recreated so the refactoring is totally useless? That will likely negate any minuscule speed improvements that were gained from that refactoring, and at the same time might still miss other possible regressions.
     6Yep, a "translation layer" would probably work. But wouldn't adding that layer basically mean the old code is recreated so the refactoring is totally useless? That will likely negate any minuscule speed improvements that were gained from that refactoring, and at the same time might still miss other possible regressions. Also see above about unexpectedly running more filters for pages now. That can be considered a regression too.
    77
    88> Looking at the two lists, I don't think any of the values is truly unsupported by `WP_Query`, it's more about adjusting the names, for example `post_modified_gmt` and `modified_gmt` should map to `modified` so that it works in `WP_Query` (the GMT value will be sorted just the same as the non-GMT value since they are just in a different timezone). It's trivial to add such logic, so let's do it for all previously supported orderby fields.