I tend to use the second example, where the prefix matches the slug of the CPT I’m using them on.
book_authour etc. On options pages I use a prefix that indicates the type of option it’s for, for example
site_options_field_name. I have, in the past used a prefix that represented the client, but I stopped doing that when I started reusing field groups and needed to rename them all to match another client.
To be honest, I don’t think that there is a “standard WordPress practice” except that the top level fields should have a prefix and I try to make sure that my field names will not conflict with any of the more popular plugins, and I like using things that will be reusable.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.