Changeset 9178 for trunk/src/bp-xprofile/bp-xprofile-filters.php
- Timestamp:
- 11/25/2014 04:40:27 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-filters.php
r9073 r9178 324 324 325 325 /** 326 * Parse 'xprofile_query' argument passed to BP_User_Query. 327 * 328 * @since BuddyPress (2.2.0) 329 * 330 * @param BP_User_Query User query object. 331 */ 332 function bp_xprofile_add_xprofile_query_to_user_query( BP_User_Query $q ) { 333 global $wpdb; 334 335 if ( empty( $q->query_vars['xprofile_query'] ) ) { 336 return; 337 } 338 339 $xprofile_query = new BP_XProfile_Query( $q->query_vars['xprofile_query'] ); 340 $sql = $xprofile_query->get_sql( 'u', $q->uid_name ); 341 342 if ( ! empty( $sql['join'] ) ) { 343 $q->uid_clauses['select'] .= $sql['join']; 344 $q->uid_clauses['where'] .= $sql['where']; 345 } 346 } 347 add_action( 'bp_pre_user_query', 'bp_xprofile_add_xprofile_query_to_user_query' ); 348 349 /** 326 350 * Filter meta queries to modify for the xprofile data schema. 327 351 *
Note: See TracChangeset
for help on using the changeset viewer.