Home Forums General Issues Field name clashes across field groups


Field name clashes across field groups

  • Hi there. Just submitted this as what I thought was a bug – now realised it was my own error, so am just posting this here in the hope that it’ll save someone else the pain…

    If you have more than one field group appearing on the same page, be sure that none of the variables used in your field groups share the same name.

    It’s fine for them to have the same labels, but you’ll probably notice some pretty weird stuff going down when you save the page if there are name clashes. I just encountered the horror of saving a repeater item, only to find it appeared in a repeater in a completely different field group after the save! All this because both repeaters were named items.

    I solved this by namespacing my field names – eg. group1_items and group2_items.

    Developers: would automatic namespacing of fields be an acceptable feature request?


  • Glad you worked out your problem. Also, in case you haven’t run into it, all fields used on any options page must also be unique (unless you save the values to a post_id which was added in 5.2.7)

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

The topic ‘Field name clashes across field groups’ is closed to new replies.