Support

Account

Home Forums ACF PRO have_rows broke acf_form data.

Unread

have_rows broke acf_form data.

  • Hello, I ran into such a problem.
    acf version 5.7.3, WordPress 4.8.7
    I have few function before calling acf_form(), that check some fields in form And determine what layout will be.

    			if ( have_rows( 'location_1' ) ):
    				while ( have_rows( 'location_1' ) ) : the_row();
    					if ( get_sub_field( 'property_address' ) ) {
    						$location1class = ' location1class';
    					}
    				endwhile;
    			endif;
    			if ( have_rows( 'location_2' ) ):
    				while ( have_rows( 'location_2' ) ) : the_row();
    					if ( get_sub_field( 'property_address' ) ) {
    						$location2class = ' location2class';
    					}
    				endwhile;
    			endif;
    			if ( have_rows( 'location_3' ) ):
    				while ( have_rows( 'location_3' ) ) : the_row();
    					if ( get_sub_field( 'property_address' ) ) {
    						$location3class = ' location3class';
    					}
    				endwhile;
    			endif;
    			if ( have_rows( 'location_4' ) ):
    				while ( have_rows( 'location_4' ) ) : the_row();
    					if ( get_sub_field( 'property_address' ) ) {
    						$location4class = ' location4class';
    					}
    				endwhile;
    			endif;
    			acf_form( array(
    				'field_groups' => array( 2187 ),
    				'submit_value' => 'Save Changes'
    			) );
    

    I have some data to be load in form. But in some reason. When i call have_rows() data wipe from fields, can you give me some advice, why it happens or haw i can fix it.

    I can’t use have_rows aftercalled acf_form()

Viewing 1 post (of 1 total)

The topic ‘have_rows broke acf_form data.’ is closed to new replies.