Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can I auto-populate a profile field in Buddypress?

  • Avatar of Jfcarter
    jfcarter
    Participant

    @jfcarter

    I’d like to pre-populate some BuddyPress profile fields with certain information.

    Where would I go to add the information/code that I want to appear in a specific profile field?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Avatar of jivany
    jivany
    Participant

    @jivany

    At what point? On registration? Any field you tag as required will need to be filled out by the user when they register.

    Avatar of jivany
    jivany
    Participant

    @jivany

    At what point? On registration? Any field you tag as required will need to be filled out by the user when they register.

    Avatar of stwc
    stwc
    Participant

    @stwc

    If it’s on registration, work with a child theme as described in this thread: http://buddypress.org/forums/topic/adding-some-text-to-the-signup-form

    Then just prepopulate the fields (assuming it’s static info for all registrants) using standard forms HTML stuff.

    If it’s dynamic info, well, same first step, but after that, I’m out of my depth! ;-)

    Avatar of stwc
    stwc
    Participant

    @stwc

    If it’s on registration, work with a child theme as described in this thread: http://buddypress.org/forums/topic/adding-some-text-to-the-signup-form

    Then just prepopulate the fields (assuming it’s static info for all registrants) using standard forms HTML stuff.

    If it’s dynamic info, well, same first step, but after that, I’m out of my depth! ;-)

    Avatar of Jfcarter
    jfcarter
    Participant

    @jfcarter

    After registration. These are not required fields.

    Avatar of jivany
    jivany
    Participant

    @jivany

    Well, you should be able to create pretty much everything you need in your theme’s functions.php file.

    First you need to decide at what point you want to populate the fields. Find a hook in the code to attach to by looking for do_action(‘some_action_hook_name’) calls. In your functions.php file, make a new function and call something like:

    add_action('some_action_hook_name','my_nifty_auto_pop_function');

    Then create your nifty_auto_pop_function that fills in the xprofile fields you want to populate.

    Look in the bp-xprofile directory for all of the different files/functions to help fill in and read profile fields.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘How can I auto-populate a profile field in Buddypress?’ is closed to new replies.