Make WordPress Core

Opened 2 months ago

Last modified 2 months ago

#59514 new enhancement

Add more context to split_the_query filter

Reported by: spacedmonkey's profile spacedmonkey Owned by:
Milestone: 6.5 Priority: normal
Severity: normal Version: 3.4
Component: Query Keywords: has-patch
Focuses: performance Cc:

Description

Current the split_the_query filter has the current WP_Query instance as context. However to calculate the value you need the value variables.

  • $old_request
  • $limits
  • $fields
  • $q ( query arguments ).

It is worth noting that $this->request can be received by WP_Query instance and $wpdb->posts can be received from global $wpdb.

With this extra context, will be make the filter much more useful.

Change History (3)

This ticket was mentioned in PR #5363 on WordPress/wordpress-develop by @spacedmonkey.


2 months ago
#1

  • Keywords has-patch added

#2 @spacedmonkey
2 months ago

Ping @tillkruess for review.

#3 @tillkruess
2 months ago

Huge +1. No downsides.

Note: See TracTickets for help on using tickets.