I've created a custom field using ACF to display the editors of a page (this may be a comma separated list of a few) including a link to their archive, but all I'm getting is a plain text 'Array'. Could someone help me get this right? For some reason I'm not finding the right info through the documentation.
if(get_field('editor')) { echo ', edited by ' . get_field('editor') . '';}
$values = get_field('editor'); if($values) { foreach($values as $value) {
echo ' ' . $value . ','; } }
print_r()
instead ofecho
to see the contents of the array. That's purely a PHP question, hence off-topic.Array ( [0] => Array ( [ID] => 1 [user_firstname] => Name [user_lastname] => Surname [nickname] => admin [user_nicename] => admin [display_name] => Name Surname [user_email] => [email protected] [user_url] => [user_registered] => 2013-07-10 10:41:07 [user_description] => [user_avatar] => ) )