mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-02 19:54:28 +00:00
Support date_query by user_registered in WP_User_Query.
Props ChriCo, nacin. Fixes #27283. git-svn-id: https://develop.svn.wordpress.org/trunk@29934 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -451,7 +451,8 @@ class WP_Date_Query {
|
||||
|
||||
$valid_columns = array(
|
||||
'post_date', 'post_date_gmt', 'post_modified',
|
||||
'post_modified_gmt', 'comment_date', 'comment_date_gmt'
|
||||
'post_modified_gmt', 'comment_date', 'comment_date_gmt',
|
||||
'user_registered',
|
||||
);
|
||||
|
||||
// Attempt to detect a table prefix.
|
||||
@@ -463,7 +464,8 @@ class WP_Date_Query {
|
||||
*
|
||||
* @param array $valid_columns An array of valid date query columns. Defaults
|
||||
* are 'post_date', 'post_date_gmt', 'post_modified',
|
||||
* 'post_modified_gmt', 'comment_date', 'comment_date_gmt'
|
||||
* 'post_modified_gmt', 'comment_date', 'comment_date_gmt',
|
||||
* 'user_registered'
|
||||
*/
|
||||
if ( ! in_array( $column, apply_filters( 'date_query_valid_columns', $valid_columns ) ) ) {
|
||||
$column = 'post_date';
|
||||
@@ -480,6 +482,9 @@ class WP_Date_Query {
|
||||
'comment_date',
|
||||
'comment_date_gmt',
|
||||
),
|
||||
$wpdb->users => array(
|
||||
'user_registered',
|
||||
),
|
||||
);
|
||||
|
||||
// If it's a known column name, add the appropriate table prefix.
|
||||
|
||||
Reference in New Issue
Block a user