Home Forums Add-ons Repeater Field Create a repeater row based on input


Create a repeater row based on input

  • Hi,

    I have two field groups, one is a repeater field group and the other is a form field group. I have had a look at the add_row() function but not sure how to implement it or if it is even possible. I would like to add a row based on an input from the second field group.

    repeater field :

            <?php if( have_rows('category_lists') ): ?>
            <ul class="grid">
              <?php while( have_rows('category_lists') ): the_row(); ?>
    	   $title = get_sub_field('title');
    	   $category = get_sub_field('category');
    	   $icon = get_sub_field('icon');
             <?php endwhile; ?>
            <?php endif; ?>

    and my form

    		'post_id'		=> 'new_post',
    		'post_title'	=> true,
    		'post_content'	=> true,
    		//'post_taxonomy' => true,
    		'new_post'		=> array(
    			'post_type'		=> 'repository',
    			'post_status'	=> 'publish'
    		'submit_value'		=> 'Upload new document',
    		'return' => '%post_url%',
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.