Search Results for 'profile fields'
-
AuthorSearch Results
-
August 29, 2017 at 11:47 am #267760
In reply to: bp-custom.php in folder?
Carsten Lund
ParticipantI am looking at the thread “Adding profile fields to members directory”
https://buddypress.org/support/topic/adding-profile-fields-to-members-directory/You wrote:
There’s 2 ways of doing this.
1. You could modify the members-loop template (see the BuddyPress Template Hierarchy for details on how that’s done). See here. You would just add bp_member_profile_data( ‘field=the field name here’ ); to the template.
2. Add this to your theme’s functions.php file:
function add_info_to_members_loop() {
echo bp_get_member_profile_data( ‘field=the field name here’ );
}
add_action( ‘bp_directory_members_item’, ‘add_info_to_members_loop’ );Which template are you referring to in 1.?
can both code snippets be placed either in functions.php or bp-custom.php?August 22, 2017 at 9:36 am #267655Peter Hardy-vanDoorn
ParticipantTry this plugin. It hasn’t been updated for 2 years, but it works perfectly for me.
Adds these options to the visibility options: ‘Admin’, ‘Everyone (Admin Editable)’ and ‘Only Me (Admin Editable)’
Hope that helps
August 20, 2017 at 11:23 am #267623In reply to: Custom Code
Abdullah Al Mamun
Participant@peter-hamilton Im using BuddyPress Xprofile Custom Fields Type plugin too.
August 9, 2017 at 4:20 pm #267455In reply to: City, State, Country Location Plugin
udarmo
ParticipantDo you know if in DB all these fields are one long string?
I’m looking for same thing, but I want to search by several fields (BP profile search) and I don’t see how it works with it.August 3, 2017 at 4:20 pm #267371In reply to: Edit Profile Visibility Problems
r-a-y
KeymasterThis only takes effect for other created profile fields, not the “Name” field.
Try creating a new profile field and then you should be able to access the options you are looking for.
July 24, 2017 at 7:01 pm #267192In reply to: Remove Base
Aslan Guseinov
ParticipantHi, you can rename it.
Go to Users=>Profile Fields=>Edit Group.June 28, 2017 at 7:01 am #266722In reply to: How to add profile fields
wbcomdesigns
ParticipantJune 8, 2017 at 10:39 pm #266376coolhunt
Participant<table class="profile-fields"> <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> <?php if ( bp_field_has_data() ) : ?> <tr<?php bp_field_css_class(); ?>> <td class="label"><?php bp_the_profile_field_name(); ?></td> <td class="data"><?php bp_the_profile_field_value(); ?></td> </tr>I found this at bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php
I have no idea about HTML.. any tips?
May 29, 2017 at 1:54 pm #266175Topic: Change xprofile fields based on user role
in forum How-to & Troubleshootinggebkn
ParticipantHi
My site has different user types/roles that each have different profile fields they need to fill out when registering. I have handled this by hiding/showing fields on the registration page with jQuery based on the chosen user type. The problem being that this solution is hard to maintain when adding/removing fields, so I am looking for a better solution.
I want to use the different xprofile groups and connect each group to each of the user types, which I have managed. The problem is I could not show more than the default group on the registration page (I have searched and tried a bunch of solutions for this to no avail).
I think I will have to make users only fill in username+password+email and then redirect them to a form where they fill out the user type, followed by the profile fields in the group that corresponds to the chosen type.
Any tips on how to do this? I couldn’t find any plugins that handles this unfortunately.I hope I explained my problem properly
May 20, 2017 at 1:26 am #266063In reply to: How can I change the image path?
metalhead
ParticipantRead this conversation in its entirety.
The plugin author was kind enough to guide me through the process of making that work. If you follow those instructions, your users will be able to upload their profile photo during registration.
Although this method works, it causes a slight problem: The users won’t be able to update their photo in the future, because the default Buddypress “Change avatar” function refers to a different file, or location, than the xprofile custom fields type location.
If you find a way to fix that problem, please let me know.
May 15, 2017 at 10:59 am #265989In reply to: Extended profile field’s value meta_key would be?
Henry Wright
ModeratorYou can get the value of an xProfile field in BuddyPress quite easily but you will need to use code. Take a look at this article to get started:
May 12, 2017 at 3:11 am #265938In reply to: required Username twice at Registration
manm0untain
ParticipantExtended Buddypress profile fields demands an additional name / username field. This is the case whether you are using Buddypress Usernames Only plugin or not.
This is only relevant if you require extended profile fields. If you don’t, then go into Buddypress settings and turn off extended profiles. That will remove the requirement for a second name on the registration / profile area.
If you want to use extended profile fields on BP, but you don’t want the second username / name field uglying up your registration flow, you can do the following.
You have to be careful with this, because if you hack it, remove the second required name / username field, or any of a dozen other solutions I’ve found – the registration will break down. You will get 500 errors, missing confirmation emails etc.
The solution I used for this is as follows.
1. Assuming you just want to use a singular Username for your site – install the Buddypress Usernames Only plugin. It says the plugin is old but it is still working as of WP version 4.7.4 (for me at least). This deals with the display / access of various username / name / fullname / nickname issues throughout the WP / Buddypress install.
2. Next you’ll need to hide the extra name / username field on the registration area, and the BP profile area. Stick this CSS into your theme custom CSS under Appearance > Customize:
#profile-edit-form .field_1 { display: none;} #signup_form .field_1 { display: none;}(I have seen a 3rd line of CSS on other solutions – #register-page p { display: none;} – all this did for me was to hide the confirmation message after the user registers. You probably want that so I’d leave that line out).
3. The fields should now be hidden, but the system still requires that information to process properly. So next create a file in notepad and save it as name_remove.js
In that file put the following javascript:
document.getElementById("signup_username").onchange = function() {myFunction()}; function myFunction() { var x = document.getElementById("signup_username"); document.getElementById("field_1") .value = x.value }Save that file and upload it to your theme folder (same folder as functions.php etc). This javascript automatically populates the hidden field with the username, so the system does not complain or fall over.
4. Finally you need WordPress to pick this javascript file up. You can do that with a function, using file enqueing. Copy and paste this function into your themes functions.php file Appearance > Editor
function wpb_adding_scripts() { wp_register_script('name_field_remove', get_stylesheet_directory_uri() . '/name_remove.js', array('jquery'),'1.1', true); wp_enqueue_script('name_field_remove'); } add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' );You have to be careful about the path. If it’s not working at this point, you can view the page source of your register page, and search for “name_remove.js” – look at the path on that script line. If the path is wrong, tweak it in the function above (you might need to change the get_stylesheet_directory_uri() part, or the path part after it. You can check if the path is correct by clicking the link to the .js file in the page source. If the path is wrong, you will get a 404 error. If the path is right, you should see the script code contained in the js file. Fiddle around with the path until it’s correct.
At that point, you have hidden the fields with CSS, and populated the second hidden username / name field automatically with javascript. Test your registration / confirmation email etc to make sure everything is working. But you should be good to go.
Hope that helps someone. Thanks to the folks I cobbled this solution together from.
April 12, 2017 at 10:29 pm #265391In reply to: How to delete fields from extended profile?
shanebp
ModeratorTry going to
.../wp-admin/users.php?page=bp-profile-setup.
If the fields appear there, you should be able to delete them.March 16, 2017 at 12:11 am #264754In reply to: Change “Name” Field to First & Last Name
maccast
ParticipantI was dealing with this problem too. It might not be exactly what you’re looking for, but in my case I just decided to hook into the BP signup, extract the full name, split it at the first space and then update the WordPress ‘first_name’ and ‘last_name’ user metadata fields with the results.
Here is the code you can add to your
functions.phpor custom plug-in:// define the bp_core_signup_user callback function ac_bp_core_signup_user( $user_id ) { // make action magic happen here... $fullname = bp_get_member_profile_data( array( 'field' => 'Name', 'user_id' => $user_id ) ); //split the full name at the first space $name_parts = explode(" ", $fullname, 2); //set the firstname and lastname for WordPress based on the BP name //firstname if( isset($name_parts[0]) ) update_user_meta( $user_id, 'first_name', $name_parts[0] ); //lastname if( isset($name_parts[1]) ) update_user_meta( $user_id, 'last_name', $name_parts[1] ); //not needed for an action, but I always like to return something return $fullname; } // BuddyPress save first name last name to WP profile on signup add_action( 'bp_core_signup_user', 'ac_bp_core_signup_user', 10, 1 );March 14, 2017 at 8:51 pm #264719In reply to: Profiles: How to expand it?
laellou
ParticipantWhen I go in administration menu users, there is no profile fields entry and i dont have a multisite, but the component is activated in the component section what can I do ?
March 12, 2017 at 4:10 am #264676In reply to: Info not saving on edit profile page
mortspud
ParticipantI have managed to fix this and here is the solution in case anyone is interested:
The problem was at the bottom of edit.php:
<input type="hidden" name="field_ids" id="field_ids" value="<?php bp_the_profile_field_ids(); ?>" />Because I manually called certain xprofile fields by their ID, I had to specify which profile fields to write back to.
This:
<input type="hidden" name="field_ids" id="field_ids" value="<?php bp_the_profile_field_ids(); ?>" />Became this:
<input type="hidden" name="field_ids" id="field_ids" value="73, 83, 106, 27" />March 8, 2017 at 9:39 pm #264586In reply to: Profiles: How to expand it?
r-a-y
KeymasterView this guide to create your own profile fields:
March 7, 2017 at 6:59 pm #264557In reply to: Record activity when xprofile field is updated
exentric
Participantok from all the reading I have done , this in buddypress is impossible to do …… any other suggestions , all i need is a field in the profile fields that when is updated will show in the activity stream ?
March 2, 2017 at 3:43 am #264440In reply to: City, State, Country Location Plugin
psnation
ParticipantYes, it works with xProfile fields. You just set it as a text box. You can see it on my registration page. No need to join the site. Just type in the city box and it’ll populate.
March 2, 2017 at 3:38 am #264439In reply to: City, State, Country Location Plugin
Henry Wright
ModeratorThat’s an interesting plugin. Do you know if the location fields are xProfile fields?
February 27, 2017 at 4:26 pm #264218In reply to: [Resolved] List Available option within custom field
Venutius
ModeratorDo you mean you have created additional profile fields? If so BP Profile Search plugin would allow you to do that.
February 26, 2017 at 10:37 pm #264195In reply to: BP profile data added to a custom post type
cbloom1919
ParticipantThank you for the response. I am trying to piece this together and am wondering- on the page that you linked me to, do I use the “Usage” code, paste it in my theme’s function.php file and use it each time I define a profile field that I need to call? If I use user_id = -1, will it just return data for the currently logged in user? Also, once the query returns the profile fields, how do I get it attached to my post? Where do I give it a parameter name?
(I’m new to php, so apologies if my questions are unclear/not using the correct terminology).
Thanks again.
February 26, 2017 at 6:13 am #264183In reply to: BuddyPress Newbie. Help needed on some issues
troy34
ParticipantThanks for your response. How do I get the users to select if they’re doctors or just normal member during registration so that they won’t have access to the extra profile fields meant for the doctors when they log in?
ThanksFebruary 26, 2017 at 1:57 am #264179In reply to: BuddyPress Newbie. Help needed on some issues
psnation
ParticipantI would suggest https://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/ to create your profile fields. There also conditional field plugins that would allow you to set up different fields to members and doctors.
February 24, 2017 at 5:08 pm #264133In reply to: Show Active Directory Fields in profile
r-a-y
KeymasterFirst, you need to figure out how to fetch the Active Directory data for a user and how to display it. This isn’t dependent on BuddyPress.
Once, you’ve figured that out, you’ll need to hook into the BuddyPress profile template to add those fields.
If you are a WordPress developer, there are various hooks you could use. View the profile template:
https://buddypress.trac.wordpress.org/browser/tags/2.8.1/src/bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.phpAnd hook into any of the
do_action()hooks to display your AD data. To get the current user’s ID on a profile page, usebp_displayed_user_id(). -
AuthorSearch Results