Does somebody know how to get the “user” selected in the user repeater field
This is wat I have (returns empty array):
<?php if( have_rows('schaduwraad') ): ?>
<?php while( have_rows('schaduwraad') ): the_row();
$author_id = get_the_author_meta( 'ID' );
$author_name = get_sub_field('reactie_author', 'user_'. $author_id );
$content = get_sub_field('reactie_content');
?>
<?php echo $content; ?>
<?php echo $author_name; ?>
<?php endwhile; ?>
<?php endif; ?>
Hi @mweterings
Thanks for the post.
Your code looks correct, perhaps you could try getting the user id using a different WP function such as get_current_user_id().
This is explained in detail here: https://codex.wordpress.org/Function_Reference/get_current_user_id