Okay
  Public Ticket #2069919
Prepopulate user details in profile fields
Closed

Comments

  •  6
    Subham started the conversation

    Hi, I have bbpress x profile fields for the user profiles. I want to pre populate some fields from the user data such as email, first name , last name .

    How can I achieve this.

    Thank you

  •  276
    Abhishek replied

    Hello,

    I am not sure I understand properly, where you want to pre populate fields from user data, since you have already have user data what don't you use display them directly.

    Maybe try this 

    https://buddydev.com/fetching-and-showing-only-specific-fields-from-buddypress-xprofile-data/

    Have a nice daysmile.png

    Kind Regards,

    Abhishek 

    Want feedback on your awesome Intranet? Get yourself a beta access on Feedier.com.

    Keen on Woffice ? Please take a few seconds to give us a 5-star review on ThemeForest.

  •  6
    Subham replied

    Hi Abhishek,

    The profile fields which are present in My profile section of every user needs to be populated.

    Example: I have a field in the profiles(buddypress X profile) namely "email". Now I want the users email to pre populate his/her email id.

    Can you atleast give me the directory where the php file containing all the profile fields on the user are present. I can add my custom code in it.

    Please find the attachment. I want to pre populate that field.

    I hope I was clear.

    Thank you.

    Attached files:  profile.PNG

  •  276
    Abhishek replied

    Hello,

    Here is the path to profile page 

    /woffice/buddypress/members/single/profile/profile-loop.php

    Have a nice daysmile.png

    Kind Regards,

    Abhishek 

    Want feedback on your awesome Intranet? Get yourself a beta access on Feedier.com.

    Keen on Woffice ? Please take a few seconds to give us a 5-star review on ThemeForest.

  •  6
    Subham replied

    Hi Abhishek,

    Thanks a lot for the directory. But my requirement is something different. Please hang up with me on this.

    As you can see in the image attached(Profile1.PNG), the Name field is pre populating the username of the user (when opened the profile on edit mode) from the database, where as you can see that the Email field is below the Name field which is not pre populating. The database already contains the user's email address. I want to pre populate the email address of the user and display it in that field (same as name). I know that Name is a primary and required field. The email is also a required field. How can I populate it so that the user does not have to fill this again.

    Hope I made some sense with my question.

    Feel free to ask me if you did not get this.

    Thank you :)

    Attached files:  profile1.PNG

  •  276
    Abhishek replied

    Hello,

    You could give it a try to map the fields you would like to pre populate

    https://wordpress.org/plugins/syncfields/

    Have a nice daysmile.png

    Kind Regards,

    Abhishek 

    Want feedback on your awesome Intranet? Get yourself a beta access on Feedier.com.

    Keen on Woffice ? Please take a few seconds to give us a 5-star review on ThemeForest.

  •  6
    Subham replied

    Hi Abhishek, 

    Thanks a lot for the plugin. Unfortunately, it was not any use to me. Can you suggest me some other alternative :)

    Thank you.

  •  276
    Abhishek replied

    Hello,

    Another approach would be to write a custom function which would activate upon profile update

    and update the xprofile fields from database by using xprofile_set_field_data() function

    http://hookr.io/functions/xprofile_set_field_data/

    Kind Regards,

    Abhishek 

    Want feedback on your awesome Intranet? Get yourself a beta access on Feedier.com.

    Keen on Woffice ? Please take a few seconds to give us a 5-star review on ThemeForest.