Support

Account

Home Forums General Issues Display Name and role using a user field Reply To: Display Name and role using a user field

  • For implode() to work, the second argument has to be an array, but I do not see the variable $user_info set anywhere.
    Now, since there could be anything behind that variable, please dump it and post what it spits out, provided that it does not reveal any sensitive information:

    <h3>Asistentes</h3>
    <div>
    <?php $users = get_field('asistentes'); ?>
    <ul>
    <?php
    foreach ($users as $user):
    var_dump( $user , $user_info );
    ?>
    <li>
    	<p><?php echo $user['display_name'];
    	echo 'User roles: ' . implode(', ', $user_info['role']) . "\n";?></p>
    </li>
    <?php endforeach; ?>
    </div>