[wp-trac] [WordPress Trac] #35907: Permit sticky posts to affect the query in REST_REQUEST
WordPress Trac
noreply at wordpress.org
Thu Jan 30 08:15:06 UTC 2025
#35907: Permit sticky posts to affect the query in REST_REQUEST
----------------------------------------+-----------------------------
Reporter: danielbachhuber | Owner: rmccue
Type: enhancement | Status: reopened
Priority: normal | Milestone: Future Release
Component: Query | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests | Focuses:
----------------------------------------+-----------------------------
Comment (by Mamaduka):
I think this was fixed by #50213.
The fix should be applied to this condition in `WP_REST_Posts_Controller`
for it to work. The `isset( $query_args['ignore_sticky_posts'] )` is
always false unless the value is filtered.
https://github.com/WordPress/wordpress-
develop/blob/21be4bc5f1e5af7c96c25d13315a9bf578b4aea7/src/wp-includes
/rest-api/endpoints/class-wp-rest-posts-controller.php#L1197-L1199
Fixing this will make Query block results consistent between the editor
and front-end. See:
* https://github.com/WordPress/gutenberg/issues/68570
* https://github.com/WordPress/gutenberg/issues/44471
@joemcgill, @desrosj, can we move this to WP 6.8 milestone?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35907#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list