Hi,
BuddyPress use templates to show his stuff.
The registration is part of WP and BP’s xprofile component add only some additionnal fields to the original register form.
If you open a template file you will see a lot of code and many lines starting by do_action( ‘something’ );
These files are all stored in bp-templates/bp-legacy/buddypress/
Now you have already the where and the what. here’s the how.
To show some text on the register page you have two options:
1) altering the whole template file bp-templates/bp-legacy/buddypress/members/register.php
2) add what you want by using an action hook
The second method is the fasted and the easiest. You just need to write a function and you’re done.
function valeriemanne() {
echo 'Here i am !';
}
add_action( 'bp_before_register_page', 'valeriemanne' );
Add this to your child theme functions.php file or into bp-custom.php
WordPress codex references
add_action
Child theme
Hi! Thank you for your answer!
But I need a page showing the profile (and not a list) of a random user.
I was thinking of using the standard loop with type = random and limit of one. And use the filter fields, as described here
is this the correct way?
Is there any progress on this?
My client needs people to input a product number to sign up for the website.
There are lots of “pending” users but I cannot see the custom Profile fields to review what the new user has put in.
There is no other way of looking at that?
The clients needs to be able to do it and lots of them, the url trick will be too hard.
One solution might be to simply display the xprofile fields, that you want to be searcable in the member directory.
Then you can simply use the member search form to search for xprofile content.
My members have a field with ‘school’ http://historielaerer.dk/medlemmer/
This snippet adds two profile fields to the members loop – add the code to your bp-custom.php:
<?php
function add_info_to_members_loop() {
$field_content = bp_get_member_profile_data( 'field=(Xprofile Field name)' );
if( $field_content != false )
echo "(label for xprofile field content): " . $field_content;
$field_content = bp_get_member_profile_data( 'field=(Xprofile field name #2' );
if( $field_content != false )
echo "<br/>" . $field_content;
}
add_action( 'bp_directory_members_item', 'add_info_to_members_loop' );
?>
Just an idea.
Kind regards, Lars
The basic layout of the items on the right side of the registration screen can be affected by moving the fields around in Dashboard>>User>>Profile Fields.
You can drag and drop them and that will affect the order that they are displayed.
An alternative might be to install BP Better Registration, which creates a different type of registration process.
You might benefit from visiting my website http://buddyuser.com It’s aimed at newbies looking to get the most out of BuddyPress.
Hi there,
You might like to check out my page on setting up users
http://buddyuser.com/setting-up-site-members-with-buddypress
This includes details of adding additional profile fields to the users profile. Also check out the section “Installing BP” in my site, I’m sure it will give you a lot of useful information.
Hi @danbp
thanks for your Tipp.
he problem is, that BP Auto Group Join lets me add users to groups only by “Member Types” not by vustom xProfile fields.
Is there anyone here, who could customize the plugin for us?
The intended data flow would be:
Input via Gravity Forms -> Gravity Forms User Registration Add-On adds a new user with certain xProfile information -> Modified “BP Auto Group Join” adds new user to certain BP groups.
Thanks for helping!
Matt
For your information:
I manage this project for a Non-Profit-Organsation called “Economy for the common good”, which stives for a new economic system. He have associations all over Europe which are recognised as charitable.
Please see here for more Info:
https://en.wikipedia.org/wiki/Economy_for_the_Common_Good
https://old.ecogood.org/en
OK, we got it to work in a different way. Special thanks to @coffeywebdev for the help.
For those interested:
This snippet is used in the functions.php to get the locations from the profile fields and show the flag image.
function dh_get_flag_by_location($country){
if($country <> '' && !empty($country)){
$country_filename = get_stylesheet_directory_uri() . '/img/flags/' . sanitize_file_name($country) . '.png';
$country_path = get_stylesheet_directory() . '/img/flags/' . sanitize_file_name($country). '.png';
if(file_exists($country_path)){
$html = '<img src="' . $country_filename . '"/>';
} else {
$html = $country;
echo '<!--' . get_stylesheet_directory_uri() . '/img/flags/' . sanitize_file_name($country) . '-->';
}
echo $html;
}
}
Then we needed to change 2 templates to show this flag image in
the Bbpress forum replies and on the buddypress members page. So we added the code necessary to show the flag
bbpress/loop-single-reply.php
<div id="country" style="float:left;margin-right:.5em;"> <?php $user = get_userdata( bbp_get_reply_author_id() ); $country = xprofile_get_field_data( 42, $user->ID ); dh_get_flag_by_location($country); ?></div>
buddypress/members/members-loop.php
<div class="member-location"> <?php $country = bp_get_member_profile_data('field=Location'); dh_get_flag_by_location($country); ?></div>
It could be, difficult to answer since you have not given a great deal of detail on what features you want. You can create multiple extra profile fields which are searchable, you can use a plugin like BP Profile Search to enable all sections of the profile to be searchable, and of course BP supports public and private forums.
What do you mean with standalone version @danbp? I use a bbpress and buddypress plugin. I figured this is more for Buddypress since it has to do with buddpress profile fields.
Anyway thanks for the code, looks good! But it doesn’t seem to work after adding it into the functions.php. I haven’t got experience using filters so can’t seem to find the problem..
Hi @davidself1001,
i think BP Profile Tabs is a plugin to create “nice looking tabs using the jQuery UI”, it is not the xprofile component !
xprofile fileds and field groups (the tabs) management is located at
dashboard > users > profile fields. What you see on that screen is normally what you have in the DB.
Once you created fields and field groups in xprofile, you will see the group tabs in the plugin.
Hi,
xprofile use 4 tables: _xprofile_data, _wprofile_fields, _xprofile_groups and _xprofile_meta
But your description is unclear. Which settings are you talking about ? The one on dashboard or the one on profile, on front-end ?
Can you give an example of your profile settings and tell what do you think is missing in regard of the DB content.
It relate to this filter bp_get_profile_field_data
This example will hide tabs and fields to all except admin
function bpfr_hide_profile_field_group( $retval ) {
if ( bp_is_active( 'xprofile' ) ) :
// hide profile group/field to all except admin
if ( !is_super_admin() ) {
//exlude fields, separated by comma
$retval['exclude_fields'] = '1';
//exlude groups, separated by comma
$retval['exclude_groups'] = '3';
}
return $retval;
endif;
}
add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_field_group' );
These tricks hide the tab content, not the tab itself. (it seems that it doesn’t work for groups at the moment…i asked devs for information) Use CSS display:none to hide the tab or consider this plugin.
Sorry for the outdated trick.
bp_is_profile_edit is deprecated in favor of bp_is_user_profile_edit.
Check for the outdated fn in the plugin mentionned in the error msg.
In case of, here a tutorial with more options.
– Single profile page. From show tab and from EDIT tab (see snippet)
– From dashboard profile edit page: not possible – normally BP users shouldn’t have access to profile dashboard. They can manage their profile from front-end.
– From custom profile fields. (see snippet)
– From tabs every where. (see snippet)
Almost any described areas, as example
function bpfr_hide_profile_edit( $retval ) {
// remove field from edit tab
if( bp_is_profile_edit() ) {
$retval['exclude_fields'] = '54'; // ID's separated by comma
}
// allow field on register page
if ( bp_is_register_page() ) {
$retval['include_fields'] = '54'; // ID's separated by comma
}
// hide the field on profile view tab
if ( $data = bp_get_profile_field_data( 'field=54' ) ) :
$retval['exclude_fields'] = '54'; // ID's separated by comma
endif;
return $retval;
}
add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_edit' );
This issue is resolved.
The problem was with Buddydev’s Conditional Profile Fields plugin. For me, to fix the problem, I figured out that I had to set all conditional fields to unconditional, then make any necessary changes to the profile fields, then when satisfied, go back and set the conditional statements, then the problem of not being able to save was gone.
@bramdehaan, if you go to Users > Profile Fields, then click Edit next to the date field you want to fix, you can select one of the two options in Range and fill in the values you want (this is for the years that will be displayed).
@danbp
Thanks again.
I’d missed the second example, but, unfortunately, it doesn’t solve the issue.
If not enough, you use CSS display:none; for the BASE markup on profile edit tab.
I attempted to do this but I’m unable to target the BASE group without also affecting the USER INFO group
I noticed, too, that the “hide fields or field group to members, but not to site admin” code was preventing user registrations from going through, for some reason. It was quickly redirecting users to the home page, rather than a success or failure message page, when they clicked on the “complete sign up” button.
I think what I’ll have to do is put all fields in the BASE group & go with what @shanebp suggested in the thread I linked in my first post. & hope that potential subscribers aren’t put off by the registration form.
Hi @danbp,
Thanks for your reply.
I tried that & the outcome was the same, ie the fields are hidden but the ‘Base’ profile group field is the same, like this
I guess a solution would be to put all fields in the ‘Base’ group & delete the “User Info” group, but this would mean that all fields would show up on registration (albeit, not all ‘required’). This is something I wanted to avoid, as I want to make it as quick & easy as possible for visitors to sign up – I don’t want to overwhelm them on sight of the registration form.
Hi,
I want to hide the entire Base Profile Field Group on my site.
I have followed the steps outlined by @shanebp in this topic &, while the Base Profile Fields have been hidden, the tab for the Group is still visible.
I have posted a screenshot of the issue here.
I want just the profile group ‘user info’ to be visible & editable.
I’m using the Kleo theme – version 4.1.5, WordPress 4.6.1.
I’d greatly appreciate some help.
My install has stopped sending any emails out for new user activation.
I can receive emails sent by WordPress after a user is manually activated, and can receive any email from Postman SMTP, as these test emails work.
I don’t use any other activity markers, but emails were not received when messages were sent either.
I have tried all of the listed troubleshooting steps that others have gone through before.
I have a custom function that creates a post for the user during the registration process. I have removed all custom functions and tried registering a user, and it still will not send any emails.
As BuddyPress uses it’s own PHP Mailer, I am not able to log them via any WP Mail logging tools, and want to see what might be going on here.
The problem reared its head around the time I upgraded to 2.6 (although the custom function during registration was also added at this time) as well
I have reset the emails multiple times, and I have not made any changes to them.
Could someone please provide assistance, or given me a suggestion on how to run the BP Email Debug code to get an email of any issues
Host is Bluehost
Here is my install, and plugin list
WordPress 4.5.4
BuddyPress 2.6.2
Advanced Custom Fields 4.4.10
Akismet 3.1.11 (inactive)
BackWPuP 3.3.4
BP Force Profile Photo 1.0.5
BP Member Type Manager 1.0.1 (inactive)
BP xProfile Location 1.2
BP XProfile WordPress User Sync 0.6.4
Broken Link Checker 1.11.2
Buddy Progress Bar 1.0.2
BuddyPress Conditional Field Groups 0.1.0
Buddypress Conditional Profile Field 2.0
Buddypress Geodirectory Integration 1.0.0 (inactive)
BuddyPress Member Type Generator 1.0.2
BuddyPress Profile Tabs 1.6.1
BuddyPress Security Check 2.1.2
BuddyPress Simple Terms And Conditions 1.3
BuddyPress Xprofile Custom Fields Type 2.5
BuddyPress Xprofile Member Type Field 1.0.4
Cherry Parallax Plugin 1.0.0 (for my theme)
Cherry Plugin 1.2.8.1 (for my theme)
Conditional Profile Fields for BuddyPress 1.1.9
Contact Form 7 4.5
Contact Form 7 – Dynamic Text Extension 2.0.1
Custom Hooks 1.0 (All my custom functions are in this plugin)
Custom Login 3.2.5
Custom Post Template By Templatic 1.0
Custom Post Type UI 1.4.1
Disable Comments 1.5.2
Display Posts Shortcode 2.7.0
Easy Parallax Slider 2.1.1
FacetWP 2.6.4
GEO my WP 2.6.6.1
GeoDirectory 1.6.5 (inactive)
Hello Dolly .1.6 (inactive)
MOJO Marketplace 1.0.1 (inactive)
MotoPress Content Editor Lite 1.6.5 (inactive)
Quick and Easy FAQs 1.0.3
SuitePlugins – Advanced XProfile Fields for BuddyPress 1.0.3
Super Socializer 7.8.1
WP Private Content Plus 1.11
WPFront User Role Editor 2.12.4
Yoast SEO 3.5
I’m using a plugin called Buddypress Xprofile Custom Fields Type.
If I edit a profile field, Buddypress begins to malfunction by not letting a new user save his info entered into the register.php form.
So if I delete all my profile fields, and then re-create them, Buddypress will begin to function properly again, but, then I create custom profile search widgets with a plugin called “Buddypress Profile Search,” and then the problem starts again. (User can’t save the data he entered. Registration page just refreshes.)