Created
August 14, 2018 02:10
-
-
Save KaineLabs/790289dd25014391ce4b7dc811d7cf5a to your computer and use it in GitHub Desktop.
Add Members Directory Custom Meta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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