[buddypress-trac] [BuddyPress] #1699: add filters to the queries of function get_users()

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Tue Jan 26 10:33:20 UTC 2010


#1699: add filters to the queries of function get_users()
------------------------+---------------------------------------------------
Reporter:  grosbouff    |       Owner:     
    Type:  enhancement  |      Status:  new
Priority:  major        |   Milestone:  1.2
Keywords:               |  
------------------------+---------------------------------------------------
 Hi, I think you should add filters to the queries done by function
 get_users() :

 eg. with my plugin bp-real-names :

 when you search a user by "word", the core query looks like :

 SELECT COUNT(DISTINCT u.ID) FROM wp_users u LEFT JOIN wp_usermeta um ON
 um.user_id = u.ID LEFT JOIN wp_bp_xprofile_data pd ON u.ID = pd.user_id
 WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND pd.field_id =
 1 AND pd.value LIKE '%%admin%%' ORDER BY pd.value ASC

 but I need to be able to change this to

 SELECT COUNT(DISTINCT u.ID) FROM wp_users u LEFT JOIN wp_usermeta um ON
 um.user_id = u.ID LEFT JOIN wp_bp_xprofile_data pd ON u.ID = pd.user_id
 WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND pd.field_id =
 4 AND pd.value LIKE '%%Smith%%' ORDER BY pd.value ASC

 This is not possible actually as I see...

-- 
Ticket URL: <https://trac.buddypress.org/ticket/1699>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list