This commit is contained in:
Hanson.xyz Dev
2026-01-04 17:50:08 -06:00
parent 7e45ce0756
commit acc8ac87a0
4131 changed files with 232562 additions and 250244 deletions
+23 -12
View File
@@ -482,17 +482,25 @@ class WP_Date_Query {
global $wpdb;
$valid_columns = array(
'post_date',
'post_date_gmt',
'post_modified',
'post_modified_gmt',
'comment_date',
'comment_date_gmt',
'user_registered',
'registered',
'last_updated',
'post_date', // Part of $wpdb->posts.
'post_date_gmt', // Part of $wpdb->posts.
'post_modified', // Part of $wpdb->posts.
'post_modified_gmt', // Part of $wpdb->posts.
'comment_date', // Part of $wpdb->comments.
'comment_date_gmt', // Part of $wpdb->comments.
'user_registered', // Part of $wpdb->users.
);
if ( is_multisite() ) {
$valid_columns = array_merge(
$valid_columns,
array(
'registered', // Part of $wpdb->blogs.
'last_updated', // Part of $wpdb->blogs.
)
);
}
// Attempt to detect a table prefix.
if ( ! str_contains( $column, '.' ) ) {
/**
@@ -525,11 +533,14 @@ class WP_Date_Query {
$wpdb->users => array(
'user_registered',
),
$wpdb->blogs => array(
);
if ( is_multisite() ) {
$known_columns[ $wpdb->blogs ] = array(
'registered',
'last_updated',
),
);
);
}
// If it's a known column name, add the appropriate table prefix.
foreach ( $known_columns as $table_name => $table_columns ) {