Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Displaying a custom field in profile page

@robin-w

Moderator

quickest way would be for you to check out the code in the plugin bbp-user-information on my website.

bbp Profile Information plugin

This adds 4 fields to the display under the forum role in topics/replies and in the profile (and make those field editable for later on), and you can see how these are set up and used.

In particular under the /includes folder you’ll find the display.php shows how to create function to add this to the correct area via a filter.

add_action ('bbp_theme_after_reply_author_details', 'bbp_user_information') ;

and

add_action ('bbp_template_after_user_profile', 'user_profile_bbp_user_information') ;

and within this you’ll see the code

$usermeta = get_userdata( $user_id, 'ui_label1' );
			echo $usermeta->ui_label1;

where ‘ui_label1’ is the metadata field and takes the data from the usermeta table and displays it.

Skip to toolbar