Output selected user

Support MB User Meta Output selected userResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #38914
    YasmineYasmine
    Participant

    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;
    		}}});
    #38925
    YasmineYasmine
    Participant

    You can delete this. It was not the shortcode..

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.