Home › Forums › ACF PRO › Different values for same field groups on different options pages? › Reply To: Different values for same field groups on different options pages?
Ok, I think I came up with a working solution. Here’s the code:
Basically, each settings page needs a menu_slug and that menu_slug should have somewhat of a consistent naming convention to identify settings pages with common field groups.
Then, the settings page also needs a way of identifying the unique values, in my case they’re associated with Post Type Archives, so I’m using the Post Type.
I make sure the screen matches one of the desired settings pages, then I prefix the field with the Post Type, so I can grab the specific field setting in my theme. Hope that helps someone.
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!
💻 The next ACF Chat Fridays features a live demo of one of our most highly-requested features: registering CPTs and custom taxonomies directly in ACF. Don’t miss it!— Advanced Custom Fields (@wp_acf) February 27, 2023
📆 Friday 3rd March 3pm UTC
👉 Register here - https://t.co/3UtvQbDwNm pic.twitter.com/j4r4ouQtz9
© 2023 Advanced Custom Fields.