Support

Account

Home Forums Add-ons Repeater Field reset_rows() Saved My Code

Solving

reset_rows() Saved My Code

  • Why is reset_rows() not in the documentation? I created a function that can delete repeater rows at different times in the code. I was using the rows loop each time. But each loop started where the previous one left off.

    This gave me grief for quite a while. I found another topic with a small 3 word reply mentioning reset_rows(). Yet when i searched up the documentation its no where!

    Here is how i use it successfully:

    reset_rows('field_name', $post_id);

    • MikeD89

    • August 29, 2019 at 12:41 am

    Where abouts did you place the reset_rows code?
    And is the ‘field_name’ the name of the acf repeater loop your trying to reset?

  • You place the reset_rows() function after you break out of the rows loop. The ‘field_name’ is the Repeater field’s slug.

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

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.