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.
Thank you. This is what i am looking for. Worked perfectly.
Great glad you’re fixed !
I have a similar issue but need a little help getting it to work.
I created a custom profile field (Base, Primary) in bbpress called School, with a dropdown menu to select the school.
Based on the answer above I tried this, but nothing happened…
“$usermeta = get_userdata( $user_id, ‘School’ );
echo $usermeta->School;”
Obviously I’m missing something. Any ideas?
Thanks.
could be hundreds of reasons – most are to do with small errors in coding.
That latest version of my profile info is now on wordpress, suggest you crack that open, and see if you can alter it for a dropdown.
https://wordpress.org/plugins/bbp-profile-information/
Is there any way to add in an opt-out function to the profile? Also, is there any way to add a check box that would offer different options of providing information (keep me informed, keep me informed of all events, etc.).
Thanks for any assistance.
Here is another way to do custom profile fields:
https://codex.wordpress.org/Plugin_API/Filter_Reference/user_contactmethods
bbPress will display any of of these fields you add or remove for a users profile page, as many of few as you like.
Hello,
I need one extra Field where I can put “New Message” with this function:
<a href="<?php echo fep_query_url('newmessage', array('to' => USER ) ); ?>">Send Message</a>
CAn anybody help me how and where I must out it in, please.
Thank you