Changeset 13184 for trunk/src/bp-core/classes/class-bp-user-query.php
- Timestamp:
- 12/12/2021 02:09:02 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-user-query.php
r13108 r13184 18 18 * 19 19 * @since 1.7.0 20 * @since 10.0.0 Added $date_query parameter. 20 21 * 21 22 * @param array $query { … … 50 51 * @type array $xprofile_query Filter results by xprofile data. Requires the xprofile component. 51 52 * See {@see BP_XProfile_Query} for details. 53 * @type array $date_query Filter results by member last activity date. See first parameter of 54 * {@link WP_Date_Query::__construct()} for syntax. Only applicable if 55 * $type is either 'active', 'random', 'newest', or 'online'. 52 56 * @type bool $populate_extras True if you want to fetch extra metadata 53 57 * about returned users, such as total group and friend counts. … … 173 177 'meta_value' => false, 174 178 'xprofile_query' => false, 179 'date_query' => false, 175 180 'populate_extras' => true, 176 181 'count_total' => 'count_query', … … 283 288 $sql['order'] = "DESC"; 284 289 290 // Date query. 291 $date_query = BP_Date_Query::get_where_sql( $date_query, 'u.date_recorded' ); 292 if ( ! empty( $date_query ) ) { 293 $sql['where']['date_query'] = $date_query; 294 } 295 285 296 break; 286 297 … … 303 314 $sql['orderby'] = "ORDER BY u.date_recorded"; 304 315 $sql['order'] = "DESC"; 316 } 317 318 // Date query. 319 $date_query = BP_Date_Query::get_where_sql( $date_query, 'u.date_recorded' ); 320 if ( ! empty( $date_query ) ) { 321 $sql['where']['date_query'] = $date_query; 305 322 } 306 323
Note: See TracChangeset
for help on using the changeset viewer.