Search Results for 'profile fields'
-
AuthorSearch Results
-
February 1, 2016 at 11:30 pm #249367
shanebp
ModeratorYou can add profile fields via wp-admin > Users > Profile Fields
You can search those fields with this plugin:
https://wordpress.org/plugins/bp-profile-search/February 1, 2016 at 10:29 pm #249364In reply to: Trying to get property of non-object
shanebp
ModeratorMy guess is that another plugin or some custom code or your theme is trying to apply a filter to
bp_get_the_profile_field_idbut the$fieldis not available.Try deactivating any plugins that deal with profile fields.
To confirm that the issue is in your theme, try switching momentarily to a WP theme like 2013.
January 28, 2016 at 1:12 am #249218In reply to: Multiple Registration Forms?
Turker YILDIRIM
ParticipantI believe this not an issue because BP only needs an email, username and a password to do a succesfull registration. All other inputs may change for each site.
You can use a plugin(like “contact form”) to create registration forms and then assign form inputs into custom created xprofile fields.
January 26, 2016 at 1:39 am #249114In reply to: Setting up activated users with stored metadata
Xtremefaith
ParticipantStill working on this, I discovered something while debugging:
1) If I set my priority to 1 like so:
add_action('bp_core_activated_user', array( $this, 'setup_registration_metadata'), 1 );then in my
setup_registration_metadata()function I useadd_user_meta()to capture thefirst_name&last_namevalues at that point in time. Thankfully it makes an entry in the usermeta table with the expected value fromget_user_meta($user_id, 'first_name', true)2) Unfortunately, something else apparently is hooked afterwards (possibly a method from the “Enable BuddyPress to WordPress profile syncing”, which then overrides any value I had set for those fields so that in the end the WordPress fields are now incorrect or wiped.
It seems apparent to me that the “Enable BuddyPress to WordPress profile syncing” option is the culprit, but would that be a bug that the setting is grabbing the wrong values because even if I don’t hook into
bp_core_activated_userthe meta values that were successfully stored at registration are then wiped during activation? For example:- first_name becomes the username
- last_name is cleared completely
Setting the priority to 20 the results show that by that point the originally stored
meta_value(s) have already been wiped.January 24, 2016 at 4:11 pm #249065In reply to: Getting user_ids from database error
shanebp
Moderator‘WordPress database error: [Unknown column ‘user_id’ in ‘field list’]’
There is no
user_idfield inbp_xprofile_fields.
The correct table isbp_xprofile_data.valueis a text field, so you need quotes:AND value = '45'";Instead of
AND value !empty";tryAND value != ''";$wpdb->get_varreturns a single value. Try$wpdb->get_col.Your issues could have been solved by examining the table structure and reading reference docs like https://codex.wordpress.org/Class_Reference/wpdb.
January 23, 2016 at 2:00 pm #249034In reply to: Hide or delete tab Profile ( Base)
Hellbounds
Participant<?php do_action( 'bp_before_profile_loop_content' ); ?> <?php if ( bp_has_profile() ) : ?> <ul class="accordion"> <?php while ( bp_profile_groups() ) : bp_the_profile_group(); ?> <?php if ( bp_profile_group_has_fields() ) : ?> <?php do_action( 'bp_before_profile_field_content' ); ?> <li> <h5 class="accordion-title <?php bp_the_profile_group_slug(); ?>"><?php bp_the_profile_group_name(); ?><span class="accordion-icon"></span></h5> <div class="accordion-content"> <dl class="dl-horizontal"> <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> <?php if ( bp_field_has_data() ) : ?> <dt><?php bp_the_profile_field_name(); ?></dt> <dd><?php bp_the_profile_field_value(); ?></dd> <?php endif; ?> <?php do_action( 'bp_profile_field_item' ); ?> <?php endwhile; ?> </dl> </div> </li> <?php do_action( 'bp_after_profile_field_content' ); ?> <?php endif; ?> <?php endwhile; ?> </ul> <?php do_action( 'bp_profile_field_buttons' ); ?> <?php endif; ?> <?php do_action( 'bp_after_profile_loop_content' ); ?>January 22, 2016 at 10:38 pm #249016In reply to: Hide or delete tab Profile ( Base)
Slava Abakumov
Moderator“Tab Base”
To delete
Baseand all other fields groups names in user profile:
1. find in your theme file/buddypress/members/single/profile/profile-loop.php
2. Delete in that file: this line:<h4><?php bp_the_profile_group_name(); ?></h4>If you don’t have such file in your theme, than copy this file:
/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php
into your theme here:
/wp-content/themes/[your-theme]/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php
and remove the line that I wrote above (withh4).Members Directory – All Members
1. find in your theme file
/buddypress/members/index.php
2. Delete in that file the line with this text:id="members-all"If you don’t have such file in your theme – do the same thing as written above but for
index.phpfile.You should understand, that this will break ability to filter results on members directory page.
January 22, 2016 at 12:06 pm #248982In reply to: Members/user bulk upload
nickdanks
ParticipantI thought this would be a buddy press question as the members relate to the plugin not users for our community website with custom profile fields.
Thanks NickJanuary 19, 2016 at 2:43 pm #248850In reply to: Hide field on registration
Slava Abakumov
ModeratorAll fields that are in the first
Basefields groups will appear on registration page.
So you can just move those fields to another fields group, that you can create on this page/wp-admin/users.php?page=bp-profile-setupusing this linkhttp://cosydale.com/wp-admin/users.php?page=bp-profile-setup&mode=add_group.Another option
Find the ID of a field that you want to hide in admin area (when you edit the field it’s in the URL like this
/wp-admin/users.php?page=bp-profile-setup&group_id=1&field_id=2&mode=edit_field=field_id=2is what you need), make sure that this field is NOT required, then open style.css of your theme and add there something like this:
#profile-details-section.register-section .editfield.field_2 {display:none}
For reference: http://take.ms/lONUDJanuary 18, 2016 at 9:45 pm #248809In reply to: Major changes to Edit.php
Hastig
ParticipantI’m probably misunderstanding the question but for the first part (“List each field where I want”) are you trying to control the order the fields appear to a user on this page?
your.website/members/admin/profile/edit/group/1/
If so, have you already tried reordering them in admin panel -> users -> profile fields ?
January 18, 2016 at 9:33 pm #248807In reply to: Profile fields modyfication
Hastig
ParticipantThis plugin may be of help to you..
https://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/
This plugin add more fields type to Buddypress extension: Xprofile. The fields type added are: Birthdate.. Image.. Number within min/max values..
January 5, 2016 at 8:37 pm #248409In reply to: Members – Masonry
Hastig
Participantwithout seeing your css i can give you an ugly, possible solution..
(please backup that file before attempting the change)
delete
<div class=”profile_fields”><?php bp_member_profile_data(‘field=Organizational Name’); ?></div>replace
<div class=”item-title”> <?php bp_get_member_name(); ?> </div>with
<div class=”item-title”> <?php bp_get_member_name(); ?> <div style="display: block;"><?php bp_member_profile_data(‘field=Organizational Name’); ?></div> </div>you may want to change
style="display: block;"toclass="whateverName"and edit from your style sheet.January 5, 2016 at 7:37 pm #248408In reply to: Members – Masonry
kmw1130
ParticipantHere is my code. It is on the Members Page
if ( function_exists(‘bp_is_active’) ) {
if ( bp_has_members( $params ) ){
ob_start();
echo ‘<div class=”wpb_wrapper”>’;
echo ‘<div id=”members-dir-list” class=”members dir-list”>’;
echo ‘<ul id=”members-list” class=”item-list row kleo-isotope masonry ‘.$class.'”>’;
while( bp_members() ) : bp_the_member();
echo ‘<li class=”kleo-masonry-item”>’
.'<div class=”member-inner-list animated animate-when-almost-visible bottom-to-top”>’
.'<div class=”item-avatar ‘.$rounded.'”>’
.’‘. bp_get_member_avatar() . kleo_get_img_overlay() . ‘‘;
if ($online == ‘show’) {
echo kleo_get_online_status(bp_get_member_user_id());
}
echo ‘</div>’
.'<div class=”item”>
<div class=”item-title”>’
.’‘. bp_get_member_name() . ‘
</div>
<div class=”profile_fields”>’.bp_member_profile_data( ‘field=Organizational Name’ ).'</div>’;
‘<div class=”item-meta”><span class=”activity”>’.bp_get_member_last_active().'</span></div>’;if ( bp_get_member_latest_update() ) {
echo ‘<span class=”update”> ‘. bp_get_member_latest_update().'</span>’;
}do_action( ‘bp_directory_members_item’ ); echo ‘</div>’;
echo ‘<div class=”action”>’;
do_action( ‘bp_directory_members_actions’ );
echo ‘</div>’;
echo ‘</div><!–end member-inner-list–>
‘;
endwhile;
echo ‘‘;
echo ‘</div>’;
echo ‘</div>’;
$output = ob_get_clean();
}`
}
else
{
$output = __(“This shortcode must have Buddypress installed to work.”,”k-elements”);
}January 2, 2016 at 9:49 am #248267In reply to: WordPress user profile fields in Buddypress
Xtremefaith
ParticipantSo does this mean you cannot use standard WordPress First & Last name fields, that if I want them accessible on their profile I have to use the xprofile component? Seems either redundant to keep them in both or a waste to not use the WP standard fields.
Is there not an easy easy way to modify the profile form to make standard fields visible and editable?
January 1, 2016 at 2:42 pm #248245In reply to: Importing Members and Creating Directory
shanebp
ModeratorI’m not aware of a plugin that does what you want.
You might try https://wordpress.org/plugins/members-import/ as a starting place.
You would need to modify the code to handle profile fields like postal codes.The search function would be separate.
There are plugins that search profile fields, such as https://wordpress.org/plugins/bp-profile-search/December 24, 2015 at 11:13 am #248077In reply to: How to display a custom field?
VersGemerkt
ParticipantJigesh,
Thanks for the help! This is how it looks right now:

As you can see to the right of the profile image their are some data showing from the custom fields. @mcUK and @shanebp helped me out achieving this. BUT, this is not the correct data it should be showing for this user… It shows data that the logged in user filled in.
I logged in as the user that filled in the correct data, and then it’s showing the right data for the user. But this is because I’m logged in as that user…

NOTE: I’m transferring this data across two plugins: buddypress and learnpress. Just so you know!
This is the php in bp-custom:
<?php function bptest_show_a_field () { $user_id = bp_loggedin_user_id(); $firstname = xprofile_get_field_data( 'First Name', bp_loggedin_user_id(), $multi_format = 'comma' ); $lastname = xprofile_get_field_data( 'Last Name', bp_loggedin_user_id(), $multi_format = 'comma' ); $birth = xprofile_get_field_data( 'Date of birth', bp_loggedin_user_id(), $multi_format = 'comma' ); $education = xprofile_get_field_data( 'Highest Education Grade', bp_loggedin_user_id(), $multi_format = 'comma' ); $profession = xprofile_get_field_data( 'Profession', bp_loggedin_user_id(), $multi_format = 'comma' ); if ( ! $firstname && ! $lastname && ! $birth && ! $education && ! $profession ) { return; } else { echo 'Voornaam: ' . $firstname . '<br />' ; echo 'Achternaam: ' . $lastname . '<br />' ; echo 'Geboortedatum: ' . $birth . '<br />' ; echo 'Hoogste graad: ' . $education . '<br />' ; echo 'Beroep: ' . $profession . '<br />' ; } } add_action ( 'user_a_field', 'bptest_show_a_field' ); ?>December 23, 2015 at 5:24 pm #248048In reply to: How to display a custom field?
@mcuk
ParticipantHi David,
Copying the code method does work. (Renaming the function, the variables/fields within and the add_action bits).
Just tried this out too and it appears to work fine, though not tested thoroughly so you’d need to double check:
function bptest_show_a_field () { $user_id = bp_loggedin_user_id(); $field_one = xprofile_get_field_data( 'Field One', bp_loggedin_user_id(), $multi_format = 'comma' ); $field_two = xprofile_get_field_data( 'Field Two', bp_loggedin_user_id(), $multi_format = 'comma' ); if ( ! $field_one && ! $field_two ) { return; } else { echo $field_one ; echo $field_two ; } } add_action ( 'user_a_field', 'bptest_show_a_field' );Then put
do_action ( 'user_a_field' );in your desired location.December 23, 2015 at 1:41 pm #248044In reply to: How to display a custom field?
VersGemerkt
ParticipantGot one question now that I’m working with the provided code:
Do you have tips for using this code for multiple custom fields? How should I edit this code in bp-custom.php if I want to add multiple custom fields?
<?php function bptest_show_education_field () { $user_id = bp_loggedin_user_id(); $education_field = xprofile_get_field_data( 'Highest Education Grade', bp_loggedin_user_id(), $multi_format = 'comma' ); if ( ! $education_field ) { return; } else { echo 'Hoogste opleiding: ' . $education_field . '<br />'; } } add_action ( 'user_education_field', 'bptest_show_education_field' ); ?>I’m now trying to copy this code for every custom field, but that’s not really a clean way of doing this. And it’s not working either. Hope you can help me out with this one as well!
December 22, 2015 at 10:20 am #247957In reply to: How to display a custom field?
VersGemerkt
ParticipantHi mcUK!
Thanks for you reply. I’m working with Lotte on this issue.
I tried adding your code. Everything should be in place right now, but it’s still not showing the custom fields. I’m probably using the code wrong…
I tested your code with a custom field ‘Opleiding’ which I added in WordPress: Users -> Profile fields:

I added this to bp-custom.php:
<?php function bptest_show_opleiding_field () { $opleiding_field = bp_get_member_profile_data( 'field=Opleiding' ); if ( ! $opleiding_field ) { return; } else { echo '<span class="custom-field-text">' . $opleiding_field . '</span>'; } } add_action ( 'user_opleiding_field', 'bptest_show_opleiding_field' ); ?>Then I added this to order.php (the php file where the custom field should pop-up):
<div id="user-opleiding"> <?php do_action ( 'user_opleiding_field' ); ?> </div>What am I doing wrong? It’s probably a typo or a wrongly added term… But I can’t figure out what it is!
Hope you can help us out! Thanks for the help so far!
David
December 20, 2015 at 5:13 am #247920In reply to: How to display a custom field?
@mcuk
ParticipantHi,
Not used LearnPress so unable to comment much on that . The method I used to insert/display my own custom profile fields into a header on the user activity page was as follows (in this case, a Location field which was created in the WP dashboard).
1. Add to bp-custom.php :
//Add Location field to header if user has entered data into it //Nothing is shown if user hasn't entered anything into field function bptest_show_location_field () { $location_field = bp_get_member_profile_data( 'field=Location' ); if ( ! $location_field ) { return; } else { echo '<span class="custom-field-text">' . $location_field . '</span>'; } } //user_bio_location_field is used within the member-header php template file add_action ( 'user_location_field', 'bptest_show_location_field' );2. In my member-header.php file (which was copied into my child theme) entered the div :
<div id="user-location"> <?php do_action ( 'user_location_field' ); ?> </div><!-- #user-location - function is found in bp-custom -->Obviously the php code in step two is placed wherever you want the field to display, just put it in the correct location of the correct php file. In my case it was member-header.php but for you i’m guessing its the one that generates your order page?.
Not sure if you have already tried any of that or if it even helps!
December 19, 2015 at 5:30 pm #247908In reply to: position profile field description
dlongm01
ParticipantIn fact I have found a reasonable solution using CSS. I found some key clues on in the support forum for this plugin: Buddypress Xprofile Custom Fields Type (though I’m not using that plugin).
If anyone has any advice about how to improve this I would be glad to hear it. Thanks
/* Buddypress profile field description position*/
.editfield {
position: relative;
top: 5px;
}
.editfield label {
font-weight:bold;
margin-bottom: 30px;
}
.input field_4 {
margin-top: 5px;
}form.standard-form p.description {
margin: 0 0 15px;
position: absolute;
top: 20px;
line-height:1em;
}December 17, 2015 at 3:18 am #247832AdventureRidingNZ
ParticipantAdd me to the list. I want to be able to have a page with a members list which lists 6 xprofile fields if a particular one of those fields is populated.
December 10, 2015 at 5:42 pm #247622In reply to: Repeating Group Tabs
NickAcs
ParticipantJust an additional note to this issue – each time I refresh/revisit Profile Fields in the backend, more “Social” and “CoverOptions” tabs are added. The list grows!
November 29, 2015 at 1:29 pm #247259George Notaras
ParticipantHi Brajesh,
Thank you very much for the insight. Your reply clarifies a lot of things for me. Really enlightening.
I was planning to make my plugin able to understand the following field notation:
some field name @ some field groupfor easier/friendlier association of xprofile fields to profile properties, for which the plugin can generate metadata.
Now that I have this information, I’ll have to rethink about the implementation.
Thanks again!
Best Regards,
GeorgeNovember 29, 2015 at 12:25 pm #247255Brajesh Singh
ParticipantHi George,
No, There is no API function to fetch field group id from field group name and you will need to write your own sql query for the purpose.Also, In your example you have passed the profile_group_id to the bp_get_profile_field_data. Please note, it does not take that as a valid argument. It only accepts user_id and field. group id is not required for fetching field data.
Now, If we forget about the group name API and come to the original requirement, Do you plan to fetch the data for multiple users(In loop) or just once/twice.
For fetching data, these two functions work
You can either use
$data = xprofile_get_field_data( $field, $user_id = 0, $multi_format = 'array' )where $field is field id or name( If you know the id, It will fetch from any group, Name has the issue)
or as you specified
$data = bp_get_profile_field_data( array( 'user_id' => $user_id, 'field_id' => $field ) );The xprofile data APIs do not allow passing group in general. You either pass a field id or name.
The problem will happen when multiple fields have same name. In that case, the first field with the name matches if you use the above functions.
Another point, In both the cases, There is no group arguement and if you use field name, that will need one extra query(field id should be preferred if the id is known).
Honestly speaking, It is ok to use it one or 2 time on page but avoid using it inside the loop. If you plan to use it inside the loop, you should try to first fetch the xprofile data and cache and then use any of these functions. One way to cache will be by calling
BP_XProfile_ProfileData::get_value_byid( $field_id, $user_ids )Where $field_id is the id of field(not name) and $user_ids is one or more user ids.
Hope that helps.
-
AuthorSearch Results


