how to create a new field in profile fields?
-
hi.
i am using latest version of wordpress and buddypress.
——
i want to create a new field by code, in group1 (which will be appeared on signup page) so when user is signing up,
see that box and fill it, and cannot edit it after the account creation (for example just like USERNAME!)
(you set it once, and it cannot be edited after…)and then so i want to call that field later, and assing data to it like:
xprofile_set_field_data ('First Name', $user_data->ID, $identity->name->givenName); xprofile_set_field_data ('Last Name', $user_data->ID, $identity->name->familyName); xprofile_set_field_data ('WHO INFORMED YOU', $user_data->ID, $identity->personname);
someone suggested me this code to put it in bp-custom (but it’s not working) :
function bp_add_custom_buddy_friend() { if ( !xprofile_get_field_id_from_name('personname') && 'bp-profile-setup' == $_GET['page'] ) { $country_list_args = array( 'field_group_id' => 1, 'name' => 'whoinformedyou', 'description' => 'write your friend's name who informed you about us if no one told you about us, then write NoBody.', 'can_delete' => true, 'field_order' => 2, 'is_required' => true, 'type' => 'textbox', 'order_by' => 'custom' ); } } add_action('bp_init', 'bp_add_custom_buddy_friend');
——–
Extra information:
i am using OneAll Social Login Plugin, to put social login buttons in my login form.
in the usual signup form, i put an extra textbox (which user must fill it), in order for me to know, how this user is informed abt my website,
the question is this:
who informed you about this website? (if a friend, then write his/her name, if no one, simply write NoBody)
so if a friend suggested, the user simply write down a name(just a text, not linked to anybody’s profile)
and if not (he/she will write NoBody)
BUT
when you login from social-login, this will not be enabled!
so i want to create a new field, and call it from social-login.
so if a user is signed in from social login,
a pop up appears and force the user to enter that field.
——-
how can i create this ?
tnxxxx a lot for any help.
- You must be logged in to reply to this topic.