Home Forums Add-ons Repeater Field Accessing User Data within a Repeater Field


Accessing User Data within a Repeater Field

  • I’ve created a custom author box using the user data

    ($display_name = get_the_author_meta( 'display_name', $post->post_author );)

    etc, etc.

    That’s working quite well.

    I now need a repeater field to contain selected users (so sometimes more than just one).

    repeater field name: my_repeater_field_name
    Sub-field name (type: user): my_subfield_user_field_name (returns ID)

    Not sure how to load data from the users selected in the repeater field

    I’ve been working with (in functions.php)

    if( have_rows('my_repeater_field_name') )
     while( have_rows('my_repeater_field_name')): the_row();
     	$co_display_name = get_the_author_meta( 'display_name', $post->post_author );
    	$co_user_descriptioin = get_the_author_meta( 'user_description', $post->post_author );
    	 $co_user_website = get_the_author_meta('url', $post->post_author);
      	$co_user_posts = get_author_posts_url( get_the_author_meta( 'ID' , $post->post_author));

    (I’ll put all that stuff together later on)

    But I realize that this doesn’t mention the sub-field name, so not sure how to crack this one

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.