Make WordPress Core

Changeset 58180

Timestamp:
05/20/2024 09:19:21 PM (2 months ago)
Author:
spacedmonkey
Message:

Query: Add more context to the split_the_query filter.

Add more context to the split_the_query filter by adding two new parameters: '$old_request' and '$clauses'. This enriches the filter with additional information about the SQL query before the query is run, enabling developers to have more context to help decide if a query should be split.

Props spacedmonkey, shailu25, rcorrales, tillkruess.
Fixes #59514.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-query.php

    r58122 r58180  
    33143314             *
    33153315             * @since 3.4.0
     3316
    33163317             *
    33173318             * @param bool     $split_the_query Whether or not to split the query.
    33183319             * @param WP_Query $query           The WP_Query instance.
     3320
     3321
     3322
     3323
     3324
     3325
     3326
     3327
     3328
     3329
     3330
     3331
    33193332             */
    3320             $split_the_query = apply_filters( 'split_the_query', $split_the_query, $this );
     3333            $split_the_query = apply_filters( 'split_the_query', $split_the_query, $this );
    33213334
    33223335            if ( $split_the_query ) {
Note: See TracChangeset for help on using the changeset viewer.