Make WordPress Core

Opened 2 years ago

Last modified 8 months ago

#42762 new enhancement

rest_{$this->post_type}_query filter wrong place

Reported by: Krstarica Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 4.7
Component: REST API Keywords: has-patch
Focuses: Cc:
PR Number:


Taxonomies are added after rest_{$this->post_type}_query filter takes place, making impossible to alter the query completely.

It would be better to apply filter right before new WP_Query() in class-wp-rest-posts-controller.php:290.

Attachments (1)

42762.diff (2.8 KB) - added by TimothyBlynJacobs 8 months ago.

Download all attachments as: .zip

Change History (2)

#1 @TimothyBlynJacobs
8 months ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to Future Release
  • Version changed from 4.9.1 to 4.7

AFAICT, this was introduced like that in https://github.com/WP-API/WP-API/pull/2287

I think this can be fixed safely.

Note: See TracTickets for help on using tickets.