Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
Created August 14, 2018 02:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/790289dd25014391ce4b7dc811d7cf5a to your computer and use it in GitHub Desktop.
Save KaineLabs/790289dd25014391ce4b7dc811d7cf5a to your computer and use it in GitHub Desktop.
Add Members Directory Custom Meta
<?php
/**
* Add Members directory Custom meta.
*/
function yzc_add_md_custom_meta_fields() {
// Put Field ID or Name
$field_id_or_name = 'name';
// Get Field Data
$user_name = xprofile_get_field_data( $field_id_or_name, bp_get_member_user_id() );
// Output
echo '<span class="yz-name">'.$user_name.'</span>';
}
add_action( 'bp_directory_members_item_meta', 'yzc_add_md_custom_meta_fields' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment