Skip to:
Content
Pages
Categories
Search
Top
Bottom

Username starts from uppercase letter

  • Avatar of yu
    yu
    Participant

    @gerbilo

    It’s gonna be simple question for gurus )) What function should i edit to make first letter non-uppercase for all members (because i have nickname instead of user full name) ?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    I wouldn’t mod a function, I’d add a filter. Hang on while I look for the filter name. (brb)

    OK, what I think you’ve done is change the ‘Full Name’ profile field and called it ‘nickname’ in the BuddyPress settings area right?

    So, in bp_fetch_user_fullname() it sets up a filter for us:

    apply_filters( 'bp_fetch_user_fullname', stripslashes( trim( $data ) )

    You’d need to create a function something like:

    function my_nickname_filter($name) {
    return strtolower($name);
    }

    And register the filter with:

    add_filter('bp_fetch_user_fullname', 'my_nickname_filter')

    Hopefully bp uses the bp_fetch_user_full_name() fn everywhere. Can’t see much reason to create it if it didn’t. :)

    I see these hooks all over the place. Andy has done gone filter happy.

    Avatar of yu
    yu
    Participant

    @gerbilo

    thnx for you response! but why should i make function that make all letters lowercase? if someone have nickname “Ao2NNasa” what that function do?

    Avatar of yu
    yu
    Participant

    @gerbilo

    i get it on my own ))) just needed to comment line 247 at bp-corebp-core-templatetags.php (//$data = ucfirst($data);). and that’s it! thnx burtadsit!

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    Oh, I misunderstood what you were looking for. Happens to me at 5am. :)

    It’s still not a good idea to mod the bp core. You can still accomplish what you want with a filter. That way you don’t have to keep track of your mod and worrying about an svn update or moving from one release to the next.

    You could use the same method outlined above but replace the strtolower() with lcfirst() to take it back to normal.

    Up to you.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Username starts from uppercase letter’ is closed to new replies.