Skip to:
Content
Pages
Categories
Search
Top
Bottom

Displaying usernames on Members Directory part 2


  • takuya
    Participant

    @takuya

    I’m calling this part 2, as we have resolved thread.

    http://buddypress.org/forums/topic/display-username-in-members-directory

    Does anyone know how I can modify this code into a new function, rather than overwriting bp_member_name? I’ve tried add_function instead, but didn’t work. Preferably I’d like to create a new function called bp_member_username.

    function my_member_username() {

    global $members_template;

    return $members_template->member->user_login;

    }

    add_filter('bp_member_name','my_member_username');

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

  • takuya
    Participant

    @takuya

    bp_member_name

    bp_member_permalink

    bp_member_avatar

    Are there only 3 of functions? I can’t find information about bp_member functions on codex.


    takuya
    Participant

    @takuya

    I finally solved this according to:

    https://svn.buddypress.org/trunk/bp-core/bp-core-templatetags.php

    I’ve made a new custom function, bp_member_user_login as follows

    function bp_member_user_login() {
    echo bp_get_member_user_login();
    }
    function bp_get_member_user_login() {
    global $members_template;

    return apply_filters( 'bp_get_member_user_login', $members_template->member->user_login );
    }

    I can’t find the file this code would go in on BP, I just need to add in Member Name, Type and Location.


    takuya
    Participant

    @takuya

    This function I’ve made 10 months ago somewhat conflicts with versions (probably) higher than 1.2.5.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Displaying usernames on Members Directory part 2’ is closed to new replies.
Skip to toolbar