Hi there,
As part of my form, they can select a user. I want to output the display name of the selected user. But can't see where its going wrong! Am I using the correct helper function?
add_shortcode("academic_get_display_name", function (){
global $post;
$bbb_post_type = get_post_type($post->ID);
if('research' === $bbb_post_type){
$bbb_academic_field = rwmb_meta( 'academicinterview_transfer_author_to_academic','',$post->ID);
if ($bbb_academic_field){
$bbb_academic_name = get_userdata($bbb_academic_field)->display_name;
return $bbb_academic_name;
}}});