Support

Account

Home Forums General Issues Delete all repeater rows? Reply To: Delete all repeater rows?

  • In my case, I just wanted to complete empty my repeater field so I tried “delete_field($field_key, $post_id);” because I am constructing an array and i am using add_row to put the array into the field. My setup got a little complicated with repeater inside of repeater inside of repeater. Seemed the best approach was construct an array and use add_row.

    The delete_field seemed to do the trick, but is that a good way to completely remove all values from a repeater? That is exactly what I wanted it to do. Tested locally and appears to work.

    All other methods like delete_row() didn’t seem to work, it was always left with something in the repeater. I tried looping through and deleting rows, still same issue, it always left something behind.