Home Forums Backend Issues (wp-admin) Problem with repeaters and Actions/Filters


Problem with repeaters and Actions/Filters

  • Hello,
    I need to fill an Select2 inside an repeater dymically depending on what values are entered in its siblings.
    The problem is despite the wide range of APIs it is hard to do anything with repeaters.
    acf/load_field and acf/load_value are only triggered once per field, no matter how often it occures in the repeater.
    Also in all hooks there is no possibility to check which field in the repeater it actually is, the field name and key are the same in each row and no index or similiar is passed.
    How can I work around this problem?

    My goal is following:
    Inside a repeater there are two Select2 fields which are filled with ajax.
    After selecting the field1 (reference to diffrent acf field in another post) the second select should display all values which are in the post field selected in field1. I wired it together with JS and it works.

    But now after saving and reloading the Page the select2 field is empty. And I cannot access the value from JS but it is saved in the database and returned by the ACF api.

    How can I fill in the Select2 selected value when viewing the page despite there are no choices?

Viewing 1 post (of 1 total)

The topic ‘Problem with repeaters and Actions/Filters’ is closed to new replies.