Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Buddypress Show Xprofile Field Data in The Profile Header.
<?php
/**
* Buddypress Show Xprofile Field Data in The Profile Header.
*/
function yzc_add_xprofile_field_data_in_profile_header( $name ) {
$field_data = xprofile_get_field_data( 'Age', bp_displayed_user_id() );
if ( ! empty( $field_data ) ) {
echo '<br>Age: ' . $field_data;
}
}
add_action( 'bp_before_member_header_meta', 'yzc_add_xprofile_field_data_in_profile_header' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.