Support

Account

Home Forums Front-end Issues Getting select values from a user field in author.php using $curauth instead of

Unread

Getting select values from a user field in author.php using $curauth instead of

  • I am using Advanced Custom Fields for my author.php template. This works fine when it is a simple custom field. Problem is, as I am using the Co-authors Plus plugin, when I try to retrieve the values of a multiple select field with get_the_author_meta, it gets the values confused between co-authors. This is my code:

    <?php echo implode(', ', get_the_author_meta('custom_field_one')); ?>

    A viable solution would be to use $curauth instead of get_the_author_meta, which is what I do successfully for simple text fields, but it throws Array instead of the values when I call a multiple select field like this:

    <?php echo $curauth->custom_field_one; ?>

    What is the correct way of getting multiple select values from a user field using $curauth instead of get_the_author_meta?
    Please help!

Viewing 1 post (of 1 total)

The topic ‘Getting select values from a user field in author.php using $curauth instead of’ is closed to new replies.