Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Im trying to find a way to set the members search by name and also by username.

Now it seems to search only by name.

Thanks in advance.

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

Somebody on a different site had this to say:

I don’t recommend to change the core files of buddypress. The best way to do it is to write a custom code (I don’t know how to guide you). So if you don’t mind changing the core files, here is a quick way.

Open /buddypress/bp-core/bp-core-classes.php and change the $sql['where_searchterms'] = “AND pd.value LIKE ‘%%$search_terms%%’”; to $sql['where_searchterms'] = “AND (pd.value LIKE ‘%%$search_terms%%’ OR u.user_login LIKE’%%$search_terms%%’)” ;

If someone can guide us how to do it in bp-custom.php, it would be great.

share|improve this answer
    
Can somebody help us with a functions.php or bp-custom.php code to implement the above change? Thanks –  Álvaro Castaño Nov 22 '11 at 15:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.