Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to get a profile field content for a specific user outside BP pages?

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

  • shanebp
    Moderator

    @shanebp

    Have you tried xprofile_get_field_data?

    `
    $bio = xprofile_get_field_data(‘Bio’, $user_id);
    `

    Not sure what you mean by ‘outside’ BP…

    If you can’t use xprofile_get_field_data,
    then a custom call to your database would work, but you’ll need to figure out the id of the Bio field.
    `
    $bio = $wpdb->get_var( “SELECT value FROM wp_bp_xprofile_data WHERE user_id = $user_id AND field_id = $field_id_for_bio” );
    `


    Paul Wong-Gibbs
    Keymaster

    @djpaul

    No, don’t make a direct SQL query. Use that function in the first example. :)


    kuching
    Participant

    @substrato

    oh thank you guys I used the function as advised, works :)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to get a profile field content for a specific user outside BP pages?’ is closed to new replies.
Skip to toolbar