Skip to:
Content
Pages
Categories
Search
Top
Bottom

Pulling from existing custom fields

  • Avatar of compixonline
    compixonline
    Participant

    @compixonline

    Hi –

    I have a site which uses the Membermouse plugin. Members on the sign up form set 4 Mmebermouse custom fields to say what their job is and where they work. I need the same data in Buddypress custom fields but only one input point. I don’t want to change the existing Membermouse implementation.

    Is there a way that I could simply take the data from the Membermouse custom fields and copy it into Buddypress custom fields without allowing the member to alter anything in Buddypress? Ie, on the profile the data appears “automatically” copied across from the sign up information?

    Many thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Avatar of henrywright
    henrywright
    Moderator

    @henrywright

    Hi @compixonline

    get_user_meta() will allow you to retrieve the custom field data. You’d use the function like this:

    $data = get_user_meta( $user_id, $key, true ); where $key is the name of the custom field and $user_id is the user ID of your BuddyPress member.

    $data will then hold the custom field value you want for that particular member.

    Ref: http://codex.wordpress.org/Function_Reference/get_user_meta

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    [off-topic]

    @henrywright – can you ping me via the addy in my profile? thanks.

    Avatar of compixonline
    compixonline
    Participant

    @compixonline

    Hi –

    I really appreciate your reply… it’s a little above my head but working on it. How would you then populate the buddypress Xprofile fields (which would be the same, say user_meta is occupation I would have a BP Xprofile field “occupation” and I’d want to copy it across.

    I’d also want to hide the ability to change that field in the BP members profile, forcing them to use the Membermouse field in order to change their occupation both in the Membermouse Table and their BP profile…

    Hope you can help! Many thanks.

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

You must be logged in to reply to this topic.