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


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);

  • 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)

The topic ‘reset_rows() Saved My Code’ is closed to new replies.