Support

Account

Home Forums ACF PRO have_rows causing infinite loop when getting repeater values from another page Reply To: have_rows causing infinite loop when getting repeater values from another page

  • Okay, ultra simple version of this, with a temporary workaround.

    The problem is that have_rows uses $post_id from the current page when you don’t specifically set it, even if it’s nested in a have_rows that has it specifically set.

    1. have_rows(‘field’) <- uses current (original) $post_id
      1. have_rows(‘field’, $otherpostobj) <- uses $otherpostobj
        1. have_rows(‘otherfield’) <- uses original $post_id instead of $otherpostobj

    The workaround is to setup_postdata before the third-level have_rows, and wp_reset_postdata it once we’re done with it.

    Can this be updated to use the parent have_rows post if it’s been specifically set?