Home Forums Add-ons Repeater Field Filtering field within repeater with name=


Filtering field within repeater with name=

  • I’m trying to filter a couple fields within a repeater using the name= method. For example this first one filters the entire repeater.

    add_filter('acf/load_field/name=profile_references', 'my_function');

    But what I want is filtering only a specific field within the repeater. I’ve tried the following 2 lines and they have no effect.

    add_filter('acf/load_field/name=profile_references_0_notes', 'my_function');
    add_filter('acf/load_field/name=profile_references_notes', 'my_function');

    So is it possible?

  • It is not really possible to alter the values differently for different instances of the same repeater sub field.

    In order to filter the field at all using acf/load_field you need to use the field key. The field name changes during this filter for sub fields.

    The bigger problem is that the acf/load_field hook is only run once no matter how many rows that you have. The field is only loaded once. So it is impossible to alter the field settings for each row of the repeater.

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

You must be logged in to reply to this topic.