Title: ACF user data
Last modified: December 21, 2019

---

# ACF user data

 *  [theshae](https://wordpress.org/support/users/theshae/)
 * (@theshae)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/acf-user-data/)
 * I have an ACF repeater on user data. How can I loop through the user data for
   the current logged in user?
    -  This topic was modified 6 years, 5 months ago by [theshae](https://wordpress.org/support/users/theshae/).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [studioavanti](https://wordpress.org/support/users/studioavanti/)
 * (@studioavanti)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/acf-user-data/#post-12280068)
 * Did you try **Is user…** section in CCS doc?
 * [Updt] Ah, just tried, CCS ACF Repeater shortcode doesn’t return data for user…
 * [Updt] Curious, checking if the user repeater has values returns a positive result(“
   Repeater data found”) but then, the repeater shorcode doesn’t return any data:
 *     ```
       [if user_field=my_user_repeater]
           <p>Repeater data found</p>
           [repeater my_user_repeater]
               [user my_user_repeater_text]<br>
           [/repeater]
       [else]
           <p>No repeater data found</p>
       [/if]
       ```
   
    -  This reply was modified 6 years, 5 months ago by [studioavanti](https://wordpress.org/support/users/studioavanti/).
    -  This reply was modified 6 years, 5 months ago by [studioavanti](https://wordpress.org/support/users/studioavanti/).
    -  This reply was modified 6 years, 5 months ago by [studioavanti](https://wordpress.org/support/users/studioavanti/).
 *  [studioavanti](https://wordpress.org/support/users/studioavanti/)
 * (@studioavanti)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/acf-user-data/#post-12280332)
 * I guess there’s a bug with ACF Repeater in user’s page.
    Maybe it would require
   a fix and a parameter to pass to the Repeater shortcode as for Option page(?)
 *     ```
       [repeater field_name option=true]
         [field inner_field]
       [/repeater]
       ```
   
 *  [studioavanti](https://wordpress.org/support/users/studioavanti/)
 * (@studioavanti)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/acf-user-data/#post-12280395)
 * We can also make a custom shortcode, based on this article.
    I tried quickly,
   it works: [https://support.advancedcustomfields.com/forums/topic/repeater-field-shortcode/#post-126160](https://support.advancedcustomfields.com/forums/topic/repeater-field-shortcode/#post-126160)
 *     ```
       function acf_repeater( $atts ) {
   
       	extract( shortcode_atts( array (
       		'field' => 'field',
       		'subfield1' => 'subfield1',
       	), $atts ) );
   
       	$user_id = get_current_user_id();
       	ob_start(); 
       	if( have_rows( $field,"user_{$user_id}" ) ): 
   
       		while ( have_rows( $field, "user_{$user_id}" ) ) : the_row(); 
   
       			// vars
       			$subfieldname1 = get_sub_field( $subfield1 );
   
       			echo $subfieldname1; ?><br>
   
       		<?php endwhile;
   
       	endif;
       	$output = ob_get_clean();
   
       	return $output;
       }
   
       add_shortcode('acf_repeater_shortcode', 'acf_repeater');
       ```
   
 * usage: **[acf_repeater_shortcode field=’my_user_repeater’ subfield1=’my_user_repeater_text’]**

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘ACF user data’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-shortcode_766976.svg)
 * [Custom Content Shortcode](https://wordpress.org/plugins/custom-content-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-shortcode/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [studioavanti](https://wordpress.org/support/users/studioavanti/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/acf-user-data/#post-12280395)
 * Status: not resolved