Skip to:
Content
Pages
Categories
Search
Top
Bottom

xprofile fields on group members page


  • psmorrow
    Participant

    @psmorrow

    Hi,

    I would like to add xprofile fields to each member in a group’s list of members. I have been able to add fields to the members directory, like this:

    
    function my_diretory() {
    if ( $member_type = xprofile_get_field_data( 'Type', bp_get_member_user_id() ) ) :
    		echo '<br/><div class="type">';		
    		echo "Member type: ";
    		echo $member_type;
    		echo '</div>';
    	endif;	
    
    }
    add_filter ( 'bp_directory_members_item', 'my_directory' );

    But, how do i add this info to list of members of a group?

    If anyone can help, i will be eternally grateful!!!!

    Thanks in advance!

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

  • danbp
    Moderator

    @danbp

    Please, respect the site layout and use the code button to insert code into topics. Merci!

    To add some additionnal information on the group members directory, you need to use an action hook in place of the filter.

    Try to replace the last line by:
    add_action( 'bp_group_members_list_item', 'my_directory' );


    psmorrow
    Participant

    @psmorrow

    thanks! got it!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar