Search Results for 'profile fields'
-
AuthorSearch Results
-
April 24, 2016 at 9:08 pm #252863
In reply to: Add Buddypress Profile fields to Registration
gregsee
ParticipantHi Modemlooper, thank you, I did manage to work it out. Problem partly due to my WP theme has a social counter plugin that provides a stack of fields for links that I assumed were part of the WP or BP basic profile fields. I have set up some of my new xProfiles fields now and have it working – just need to organise these for groups better.
ThanksApril 24, 2016 at 5:59 pm #252859modemlooper
ModeratorYou can update a field with this function
xprofile_set_field_data( $field, $user_id, $value, $is_required = false ) $fields = field id $user_id = current login user id $value = inserted value $is_required = booleanHook your function to
do_action( 'bp_core_activated_user', $user_id, $key, $user )April 24, 2016 at 5:55 pm #252858modemlooper
ModeratorBuddyPress users are the same as WordPress so you can create a user using https://codex.wordpress.org/Function_Reference/wp_create_user
To set profile fields data:
xprofile_set_field_data( $field, $user_id, $value, $is_required = false ) $fields = field id $user_id = current login user id $value = inserted value $is_required = booleanApril 24, 2016 at 5:51 pm #252857In reply to: Search profile by UserId
modemlooper
ModeratorBuddyPress searches username and profile fields to find a member. You would need to develop a custom solution for this. Is this requirement for site admins? If so, you can find members by id in the admin -> Users menu item.
April 24, 2016 at 5:41 pm #252856In reply to: Add Buddypress Profile fields to Registration
modemlooper
ModeratorAny profile fields you create in the admin that are in the first section are automatically added to the registration form.
April 22, 2016 at 6:31 pm #252794In reply to: Exporting and importing user data to a new site
mairaj
ParticipantOk thank you! I was by the way referring to the custom xprofile fields that I have on my current site (the multisite one that I have now).
I assume when I import the back up database file to the new site those custom xprofile fields would be created automatically.
April 22, 2016 at 5:09 pm #252786In reply to: Exporting and importing user data to a new site
mairaj
ParticipantThank you for the reply 🙂 Since you have suggested to export TABLES OF WP_xprofile, I believe I don’t need to create any xprofile fields in the new installation.
April 19, 2016 at 10:34 am #252630In reply to: Setting Registration Page as static home page
Henry Wright
ModeratorThis doesn’t happen for me. When I set the page “Register” to a static front page, I can still see custom profile fields in the sign up form. Can you post some details about your set up?
- Theme
- Plugins active
- Do you use custom code snippets in bp-custom.php or functions.php?
- etc
April 8, 2016 at 9:00 pm #252259In reply to: Show additional fields on member profile header
ngoegan
ParticipantI still can’t get it to work. I do have header images enabled so I edited this file:
buddypress\bp-templates\bp-legacy\buddypress\members\single\cover-image-header.php
as follows:
<?php /** * Fires after the group header actions section. * * If you'd like to show specific profile fields here use: * bp_member_profile_data( 'field=About Me' ); -- Pass the name of the field * * @since 1.2.0 */ bp_member_profile_data( 'field=city' ); bp_member_profile_data( 'field=state' ); do_action( 'bp_profile_header_meta' ); ?> </div>April 8, 2016 at 8:24 pm #252254In reply to: Show additional fields on member profile header
ngoegan
ParticipantI tried this and it isn’t showing up on profile pages:
<?php do_action( 'bp_member_header_actions' ); ?> </div><!-- #item-buttons --> <?php /*** * If you'd like to show specific profile fields here use: * bp_member_profile_data( 'field=About Me' ); -- Pass the name of the field */ bp_member_profile_data( 'field=city' ); bp_member_profile_data( 'field=state' ); do_action( 'bp_profile_header_meta' ); ?>April 8, 2016 at 7:46 pm #252253In reply to: Show additional fields on member profile header
ngoegan
ParticipantI’m sorry, but where exactly in that code would I enter that? Like this?
<?php
/***
* If you’d like to show specific profile fields here use:
* bp_member_profile_data( ‘field=About Me’ ); — Pass the name of the field
*/
do_action( ‘bp_profile_header_meta’ );bp_member_profile_data( ‘field=City’ );
bp_member_profile_data( ‘field=State’ );?>
April 8, 2016 at 7:42 pm #252252In reply to: Show additional fields on member profile header
shanebp
ModeratorYou have identified the correct code location:
Assuming your field names are
CityandState, try:bp_member_profile_data( 'field=City' ); bp_member_profile_data( 'field=State' );If you need to do some formatting or add text or check for empty fields, use:
$city = bp_get_member_profile_data( 'field=City' ); echo $city;April 7, 2016 at 8:33 pm #252205In reply to: Extended Profiles Not on Register Page
concoa
ParticipantUPDATE:
I deleted all BP files and the plugin and did a reinstall.PROBLEM #1)
I am still having trouble with the Register page. I do not know what this error refers to:displays an error message:
“Profile Details
Warning: Creating default object from empty value in /home/content/p3pnexwpnas09_data01/28/2853428/html/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-group.php on line 649”Line 649 is:
$fields[ $key ]->visibility_level = $field_visibility;PROBLEM #2)
Registration submission is now working, but an auto response email is being sent. Is there something in BuddyPress (or WordPress) to disable this? I’m getting an email saying:
Hi test4,
Thanks for registering!To complete the activation of your account, go to the following link: http://blahblahblah.com/activate/ef23a0f24958c3a125917f7e3bac95f8/
I’m using s2Member to allow admin approval of registrations. This email needs to be removed. Thx.
April 4, 2016 at 12:03 am #252077In reply to: Multiple Registration Forms?
Ike Ten
ParticipantHi @ch1n3s3b0y @jokyfoot @ksimpson1986 @ksimpson1986 ,
I think I found something something close.
A free plugin called ‘Conditional Profile Fields for BuddyPress’ on buddydev.com/
It allows you to set conditions for profile field so each user has a different set of fields based on their previous answer or input.Plugin Link: http://buddydev.com/plugins/conditional-profile-fields-for-buddypress/
It does it by hiding or showing fields based on specific answer given. The great thing here is that you now have to use just one dynamic registration form for all user types or groups.
Use this tutorial for a better understanding how the plugin works http://wptavern.com/new-plugin-adds-conditional-profile-fields-to-buddypress/
I hope it helps.
March 31, 2016 at 4:07 pm #251970In reply to: Storing/Syncing with WP User meta
valuser
ParticipantThe second ask — i can’t usefully contribute!
for the first ask
Assuming your new user fills in her/his profile fields on registration
Something like the following MIGHT work.
On FIRST login a user is redirected to say .$user -> user_login.’/profile/change-avatar/’;
then add something like this to the functions.php file of your theme
function alaiam(){ global $current_user, $wpdb, $bp; get_currentuserinfo(); $user_id = get_current_user_id(); $firstname = xprofile_get_field_data( "First Name" ,$user_id); update_user_meta( $user_id, 'first_name', $firstname); $lastname = xprofile_get_field_data( "Last Name" ,$user_id); update_user_meta( $user_id, 'last_name',$lastname); $gender= xprofile_get_field_data( "Gender" ,$user_id); update_user_meta( $user_id, 'gender',$gender); $xdob= xprofile_get_field_data( "Date of Birth" ,$user_id); update_user_meta( $user_id, 'dob',$xdob); /*and so on.........*/ add_action('bp_before_profile_avatar_upload_content', 'alaiam', 10, 0);March 30, 2016 at 9:26 pm #251941In reply to: Storing/Syncing with WP User meta
DrHariri
ParticipantThanks for your response @henrywright.
That’s a very good suggestion. I actually had no idea that was possible.
So you are saying I can disable the profile/Xprofile fields and create my own BP plugin component to act as a profile tab? If yes, this is good news for me!
Thanks!
March 24, 2016 at 6:38 pm #251774allisonnance
ParticipantHow would this stop custom profile fields from site A showing up on site B? For example, on one site we have a field where the user puts their annual company revenue. We don’t want this to show on the other site/s. We need other questions. I’ve attached a screen shot.
March 24, 2016 at 4:43 pm #251768allisonnance
ParticipantThat could work for some but each site is pulling the same custom user profile fields. Each site needs different fields.
March 21, 2016 at 12:10 am #251584In reply to: How to change the profile page title?
@mcuk
ParticipantHi,
If you’re referring to the profile page of a member, the function
<?php bp_user_firstname(); ?>may work for you. Just add it into the file creating the page title within the H1 tags.Or if you created profile fields in your WP Dashboard > Users > Profile field, then another option might be to use:
<?php bp_member_profile_data ( 'field=First Name' ); ?>. Change the First Name text to whatever you called the field for the user’s first name.March 20, 2016 at 6:19 am #251532In reply to: Registration page does not work
jrytesting
ParticipantHello, I had this same problem and this is how I fixed it. It was mentioned in this thread
(https://buddypress.org/support/topic/bad-link-to-profile-edit/)
that there may be a problem in the database table “wp_bp_xprofile_groups”. For some reason the first item id there is not “1” but something else. As you change the id to 1, everything works. Then it also shows the Profile details side Name field (required) in the registration page.Also there was a problem to edit profile, it went to “Page not found”. This gets fixed also now, now you can edit the fields.
This seems to be some kind of bug in the installing process in some circumstances. I tested this by removing the BuddyPress and also deleting the BuddyPress database tables. They must be deleted manually, they wont get out by deleting the plugin.
New installation put the first id number to “3” to “wp_bp_xprofile_groups” table. Even the group_id in the table “wp_bp_xprofile_fields” was “1” (after I activated some components in BuddyPress menu, before that the tables were empty) for the first field item. So now the field item and the group item never matched.
Hopefully this helps someone. It seems that there are a lot of discussion of this problem, and this is a very annoying problem if you are really using BuddyPress.
Basically the registering had a workaround for example by using plugin “Theme my login”. The registering also looks simpler as there is not that “extra” name field. It is however unknown how BuddyPress works without that name field. Well, but perhaps that is an another story.
March 15, 2016 at 12:50 am #251231In reply to: Minor changes to user profile edit form
richdal
ParticipantThanks! I was able to copy that to my child theme
/wp-content/themes/genbu-child/buddypress/members/single/profile/edit.php
and can do some basic edits. Not familliar with making these types of changes but how would I change up some of the form field information. As an example I wanted to add some description text next to the 3 date fields for the Birth Date. If looked like those were getting generated here…
<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> <div<?php bp_field_css_class( 'editfield' ); ?>> <?php $field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() ); $field_type->edit_field_html();but not sure how to change those up.
March 8, 2016 at 2:03 am #250847In reply to: PHP to get Field-Group-ID given Field-Group-Name?
johnywhy
Participanti checked here, but not sure if answers my question:
March 7, 2016 at 6:45 pm #250817shanebp
ModeratorDid you create the phone & address fields via wp-admin > Users > Profile Fields?
BP stores profile data in a table called
{your table prefix as set in wp-config}_bp_xprofile_data.
So you need to write those fields to that table.Unless somebody here has used Form Maker, it is doubtful that you will get a detailed answer.
March 5, 2016 at 6:52 pm #250714In reply to: Using bp_parse_args() to filter members loop
shanebp
ModeratorPlease use the
codebutton when sharing code.The fields
field_idandfield_valuedo not exist in the function you are attempting to filter.
See this for accepted fields:
https://buddypress.trac.wordpress.org/browser/tags/2.2.1/src/bp-members/bp-members-template.php#L453I think you want this field
retval['include'].Something like:
function see_woman_gender( $retval ) { global $wpdb; $field_id = 3; $field_value = 'Woman'; $query = "SELECT user_id FROM " . $wpdb->prefix . "bp_xprofile_data WHERE field_id = " . $field_id . ' AND field_value = ' . $field_value; $woman_ids = $wpdb->get_col( $query ); if ( !empty( $woman_ids ) ) $retval['include'] = $woman_ids; return $retval; } add_filter( 'bp_after_has_members_parse_args', 'see_woman_gender' );There are field re meta data; I don’t think they work with profile data.
But you could try this and let us know if it works:function see_woman_gender( $retval ) { $retval['meta_key'] = '3'; $retval['meta_value'] = 'Woman'; return $retval; } add_filter( 'bp_after_has_members_parse_args', 'see_woman_gender' );March 4, 2016 at 12:13 am #250589In reply to: How to create profile fields for certain roles?
shanebp
ModeratorYou’ll need to be able to write and debug code.
You can create a template overload of this file:
buddypress\bp-templates\bp-legacy\buddypress\members\single\profile\profile-loop.phpSet a variable with the current user role. Google how to get that value.
Then create an array of profile field ids for a role.
For example :if ( $current_role == 'model' ) $show_fields = array( 1, 5, 23 ); elseif( $current_role == 'photographer' ) $show_fields = array( 1, 7, 12, 35 );Then check if the current profile field is in that array.
Something like:<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> <?php if ( in_array( bp_get_the_profile_field_id(), $show_fields ) ) : ?> <?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> <?php endif; ?> <?php endif; ?>Avoid setting any fields to ‘required’ if you’re only going to show them based on role.
-
AuthorSearch Results