Active Directory Integration
How to display AD user attributes in template (4 posts)

  1. mistercyril
    Posted 5 years ago #


    I am using the "Additional User Attributes" to get some additional data from Active Directory. Its displaying in the WordPress dashboard (on user profiles), but how can I display this in my template?

    I have a custom BuddyPress member loop, and would like to be able to display the "Additional User Attributes" next to each member.

    For buddypress profile fields I use :
    <?php bp_member_profile_data('field=fieldname'); ?>

    So what could I use to display the AD fields?


  2. stimsonm
    Posted 4 years ago #

    Did you ever figure this out?

  3. mistercyril
    Posted 4 years ago #

    Unfortunately no... Anything related to BuddyPress is usually pretty hard to get support for.

    If you ever figure it out, please do share.

  4. stimsonm
    Posted 4 years ago #

    I believe I figured this out. In the database there is a table called wp_usermeta where there are keys stored under the meta field which are all the additional attributes that come in with AD. In wp-content/plugins/buyddypress/bp-themes/bp-default/members/single/profile/profile-loop.php you add the following code after line 25 where it has this:
    <td class="data"><?php bp_the_profile_field_value(); ?></td>

    Add the following after:

    global $bp;
    $adi_mail = get_user_meta( $bp->displayed_user->id, 'adi_mail', true );
    echo '<p>Email: ' . $adi_mail . '</p>';
    $adi_department = get_user_meta( $bp->displayed_user->id, 'adi_department', true );
    echo '<p>Department: ' . $adi_department . '</p>';

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Active Directory Integration
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic