Support

Account

Home Forums Add-ons Repeater Field Repeater's Big Problem :((( , Please read it!! – thanks a lot ^^ Reply To: Repeater's Big Problem :((( , Please read it!! – thanks a lot ^^

  • I got this answer also from ACF support itself. But it seems to contradict the expert John Huebner’s answer above?

    So the final answer to this is: it is possible to name the child fields the same, as long as it is unique in a parent field.
    But then it should not be named the same subfield in any case on the same page or in different groups. Because they can cause errors????

    So which is the correct one? Even the ACF rep has me baffled 🙁

    Because the field naming is simple and the same as Tile, Image – will be very different from prefixing each subfield.
    I just want to know what is actually correct and does not lead to future errors or crashes. If naming the same subfield on a page or in a different group would result in an error, then why does ACF allow that simple and identical naming?

    Chris Mucheke (WP Engine Support)

    Hi there,

    Thanks for reaching out to us, I trust you are keeping safe!

    When it comes to naming ACF subfields for repeaters, it is generally recommended to use simple and concise names that describe the content of the subfield. You can name the subfields as Title, Image, etc. without including the parent field name, as long as these names are unique within the repeater field.

    However, if you have multiple repeater fields with the same subfield names on the same page, it can lead to data corruption and accessibility issues. To avoid this, it is a good practice to prefix the subfield name with the repeater field name, for example, if you have two repeater fields with a subfield named “Title”, you can name them as “Repeater1_Title” and “Repeater2_Title”.

    In addition, it is recommended to avoid using the same subfield names across different groups of fields, as it can also lead to data corruption and field inaccessibility. Instead, try to use unique names that describe the content of the subfield.

    To summarize, when naming ACF subfields for repeaters, use simple and concise names that describe the content of the subfield. If you have multiple repeater fields with the same subfield names on the same page, prefix the subfield name with the repeater field name to avoid data corruption and accessibility issues. And, avoid using the same subfield names across different groups of fields to prevent data corruption and field inaccessibility.

    Hope that all helps, please let me know if anything needs clarification.

    Kind Regards,

    Chris