Make WordPress Core


Ignore:
Timestamp:
10/17/2014 01:36:36 AM (10 years ago)
Author:
boonebgorges
Message:

Support date_query by user_registered in WP_User_Query.

Props ChriCo, nacin.
Fixes #27283.

File:
1 edited

Legend:

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

    r29843 r29934  
    741741            $ids = implode( ',', wp_parse_id_list( $qv['exclude'] ) );
    742742            $this->query_where .= " AND $wpdb->users.ID NOT IN ($ids)";
     743        }
     744
     745        // Date queries are allowed for the user_registered field.
     746        if ( ! empty( $qv['date_query'] ) && is_array( $qv['date_query'] ) ) {
     747            $date_query = new WP_Date_Query( $qv['date_query'], 'user_registered' );
     748            $this->query_where .= $date_query->get_sql();
    743749        }
    744750
Note: See TracChangeset for help on using the changeset viewer.