Home Forums Feature Requests Edit Group and Field Keys Reply To: Edit Group and Field Keys

  • I don’t think that globally unique field names would be an asset for everyone. For example, I build fields with the same names purposefully so that I can use the same code to retrieve them. A field group on one post type may be 50% the same as another field group on another post type. Or I may have multiple layouts that are 90% the same. With the same name I can build functions for getting the values and use them rather than different coding for every group.

    I did some testing. It is possible to change the field keys when editing the field group. This is what I did:

    • Examined the code in firebug.
    • before each field there are hidden fields in a wrapper div with a class of “meta”
    • if you remove the class name from this field you can then edit the field key in the hidden field and when you save the field group the field key will be updated to what you entered.

    I don’t know why this works, didn’t did that far. But given this it should be possible to create some custom JavaScript to remove the class from the wrapper, change the hidden field key field into a text field. Then you can change it and remove the JS when dev is done.