I just wrote a plugin to solve some of this without hacking the core. Please see:
This allows you to create network options pages with the same ACF API, you just need to add a
network attribute to the options when using
acf_add_options_sub_page. For example:
acf_add_options_page([ 'network' => true, 'post_id' => 'acf_network_options', 'page_title' => 'Network Options', 'menu_title' => 'Network Options' ]);
The values are stored in the ‘sitemeta’ table, so they are accessible across sites without needing to use the switch_to_blog function.
@elliot – There is a lot of extra code that could be reduced if there were a filters in place in the
acf_delete_metadata functions. Alternatively, this functionality could be built into the core fairly easily. If you are interested, I could create a pull request, but I would need to do so in the Pro repo.
Hope this helps some people. I am using in a production site now and will make this plugin available on the WordPress directory once I’ve tested a bit more.
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 ACF site is currently experiencing some issues.— Advanced Custom Fields (@wp_acf) September 29, 2022
We apologize for the inconvenience and we are working hard to get it back up and running as soon as possible.
© 2022 Advanced Custom Fields.