Skip to:
Content
Pages
Categories
Search
Top
Bottom

Pulling from buddypress


  • dxlwebs
    Participant

    @dxlwebs

    Hi there i’m trying to pull a field from a custom field in the profiles, everything works on the profile page but i want to pull the field to another part of wordpress but im not able to find any hook information.

    basically i have a field in profile called youtube

    in our forum section id like to pull that field and display it under their avatar on our forum.

    i dont need the entire code just the hook 🙂 thnx for any info you can provide

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

  • dxlwebs
    Participant

    @dxlwebs

    Figured it out 😀 here is my code for anyone else wanting to know

    if ( !function_exists( 'xprofile_get_field_data' ) ) { 
        require_once '/bp-xprofile/bp-xprofile-functions.php'; 
    } 
    // The ID of the field, or the $name of the field. 
    $field = 'Channel ID'; 
      
    // The ID of the user. 
    $user_id = $author_id; 
      
    // How should array data be returned? 'comma' if you want a 
    // comma-separated string; 'array' if you want an array. 
    $multi_format = 'array'; 
      
    // NOTICE! Understand what this does before running. 
    $result = xprofile_get_field_data($field, $user_id, $multi_format); 
    echo $result;

    Henry Wright
    Moderator

    @henrywright

    You don’t need this:

    if ( !function_exists( 'xprofile_get_field_data' ) ) { 
        require_once '/bp-xprofile/bp-xprofile-functions.php'; 
    } 

    If BuddyPress is active then xprofile_get_field_data() should be available.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar