Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #63307, comment 28


Ignore:
Timestamp:
04/27/2025 11:29:55 AM (8 weeks ago)
Author:
SirLouen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #63307, comment 28

    v1 v2  
    66> I think the best path is that in 6.8.1, keep the `ignore_sticky_posts` param that was added, but change the default in the rest API to `true` which will restore the behavior that the endpoint had from 4.7 -> 6.7. The Query Block can be modified to call the endpoint with `ignore_sticky_posts` set to `false`. We can then look at adding a new endpoint (`wp/v3/posts`? `wp/v2/wp_query`?) in 6.9 that more closely resembles `WP_Query`. This would honor the original REST API behavior for posts collection, while maintaining support for sticky posts.
    77
    8 I don't think this is a good idea entirely: #59801 should be reverted, as It's still buggy and needs more development. I've been looking into the code to find a quick fix, but it's not going to be as quick as I thought.
     8I don't think this is a good idea entirely: [59801] should be reverted, as It's still buggy and needs more development. I've been looking into the code to find a quick fix, but it's not going to be as quick as I thought.
    99
    10 The solution of setting the default `ignore_sticky` to `true` keeps the added functionality troubles provided by #59801 alive.
     10The solution of setting the default `ignore_sticky` to `true` keeps the added functionality troubles provided by [59801] alive.
    1111
    1212Basically, if you change the URL param behavior, all sticky posts will return (regardless of whether they match the query or not). We could argue that it's weird to add "ignore_sticky=false" to the `slug` param, but for any other param it will also break the results as it does with `slug` and it's not that weird to use this. The sole scenario where "ignore_sticky" makes sense (and to which it seemed to be tested), was against the regular no-parameters query. Probably not defaulting `ignore_sticky` and working from there could be the solution code-wise. But many extra tweaks have to be made to avoid delivering a half-cooked buggy solution.