Changeset 11886 for trunk/src/bp-xprofile/bp-xprofile-functions.php
- Timestamp:
- 03/05/2018 08:44:16 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-functions.php
r11849 r11886 785 785 // Combine the core search (against wp_users) into a single OR clause 786 786 // with the xprofile_data search. 787 $ search_xprofile =$wpdb->prepare(788 " u.{$query->uid_name} IN ( SELECT user_id FROM {$bp->profile->table_name_data} WHERE value LIKE %s OR value LIKE %s )",787 $matched_user_ids = $wpdb->get_col( $wpdb->prepare( 788 "SELECT user_id FROM {$bp->profile->table_name_data} WHERE value LIKE %s OR value LIKE %s", 789 789 $search_terms_nospace, 790 790 $search_terms_space 791 ); 792 793 $search_core = $sql['where']['search']; 794 $search_combined = "( {$search_xprofile} OR {$search_core} )"; 795 $sql['where']['search'] = $search_combined; 791 ) ); 792 793 if ( ! empty( $matched_user_ids ) ) { 794 $search_core = $sql['where']['search']; 795 $search_combined = " ( u.{$query->uid_name} IN (" . implode(',', $matched_user_ids) . ") OR {$search_core} )"; 796 $sql['where']['search'] = $search_combined; 797 } 796 798 797 799 return $sql;
Note: See TracChangeset
for help on using the changeset viewer.