Support

Account

Home Forums General Issues Grab relationship field from user profile Reply To: Grab relationship field from user profile

  • After doing a var_dump on $company, the reason why echoing $compmany wasn’t pulling anythng was because it was a wp object or wp array (I’m not sure of the correct terminology.

    I had to select the post_title in order for it to work. So I ended up with this:

    function user_organization($atts) {
    	$user_id = get_current_user_id();
    	$user_company = get_field('user_company', 'user_' . $user_id);
    	echo $user_company->post_title;
    }
    add_shortcode('user_organization_info', 'user_organization');