Support

Account

Forum Replies Created

  • You can get the value of the repeater field as an array by doing the following:

    $gig_dates = get_field('gig_dates_repeater');

    At this point $gig_dates is an array of arrays with each sub array representing a single row in the repeater, so to get the first one simply do $gig_dates[0]. This will return another array containing the sub fields of the corresponding row, for example:

    array(
        'gig_date' => 'Feb 5th',
        'gig_title' => 'Gig title'
    );

    I hope this helped.

  • This reply has been marked as private.
  • Hello John,

    Apologies for the vagueness.

    It’s a Front-end issue in Input.js in the add popup function, more specifically the get_field_key function which apparently doesn’t exist.

    Console Error

    Thanks!

  • if(have_rows('page_builder', $this_page)):
          while(have_rows('page_builder', $this_page)): the_row();
              if( get_row_layout() == 'page_content_block' ):
    
    	          $this_text = get_sub_field('page_content_editor');
    	          $this_text_plain = strip_tags($this_text);
    
                    // flexible row logic
              endif;
          endwhile;
    endif;

    I found that if you try and pass get_sub_field('repeater_page_object')->ID as the have_rows() $id parameter, it will cause an infinite loop, however, if you store these values as a variable on each loop index it works fine.

    The above is an example of how I managed to get the result I wanted. This was placed within a flexible content loop in a if (get_row_layout == 'x') { } statement.

Viewing 4 posts - 1 through 4 (of 4 total)