@webpagesindiadotnet
13 years, 5 months ago
@paulhastings0 Try this filter, it will sync user name on the fly
just paste this block of code in your template functions.php
` ///////////////////////// ///// To sync user names on the fly, it will show xprofile fullname of user ///////////////////////// function wpi_sync_member_name($data) { global $members_template, $bp;
#$firstname = xprofile_get_field_data( 1, $members_template->member->id ); // 1 = firstname > wp_bp_xprofile_fields.id #$lastname = xprofile_get_field_data( 51, $members_template->member->id ); // 51 = lastname > wp_bp_xprofile_fields.id #$fullname = $firstname .’ ‘.$lastname; #return $fullname;
return bp_core_get_user_displayname( $members_template->member->id );
} add_filter( ‘bp_get_member_name’, ‘wpi_sync_member_name’ ); `