Skip to content

Commit bd797e0

Browse files
committed
Query: fix undefined variable $q in WP_Query::generate_cache_key()
The `generate_cache_key()` method in `WP_Query` referenced an undefined variable `$q`. The method only has two parameters: `$args` and `$sql`. The variable `$q` is not defined anywhere in this method scope. This patch replaces the undefined `$q` variable with the correct `$args` parameter. Follow-up to [59442] Props ramonopoly, westonruter Fixes #64135. git-svn-id: https://develop.svn.wordpress.org/trunk@61043 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 33d4edd commit bd797e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-includes/class-wp-query.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5043,7 +5043,7 @@ protected function generate_cache_key( array $args, $sql ) {
50435043
}
50445044

50455045
// Add a default orderby value of date to ensure same cache key generation.
5046-
if ( ! isset( $q['orderby'] ) ) {
5046+
if ( ! isset( $args['orderby'] ) ) {
50475047
$args['orderby'] = 'date';
50485048
}
50495049

0 commit comments

Comments
 (0)