Support

Account

Home Forums Add-ons Repeater Field Dynamically set limit for repeater rows Reply To: Dynamically set limit for repeater rows

  • There isn’t any way to do this using a single field because the repeater will contain all of the existing rows and trying to limit this number of rows will cause issues. There isn’t a way to have one repeater that can be use to add new rows without showing all of the rows.

    To do this you would need to have 2 different fields, one repeater that is used in the admin and one that is used only on the front end.

    You can put your second field into a different field group.

    You can then specify the fields that you want to show when calling acf_form().

    When the front end field is loaded then you can add an acf/load_field filter, check the number of rows in the “real” repeater and limit the front end repeater based on that number.

    Then you create an acf/save_post filter. In this filter you transfer anything that’s in the front end repeater to the “real” repeater.