Home › Forums › Bug Reports › Multi-Sites switch_to_blog bug › Reply To: Multi-Sites switch_to_blog bug
Found this thread and after reading it I went and looked over a complex multisite that I am just about finished building.
I thought that my input might be useful for someone.
I am not seeing any problems with acf and switch_to_blog. Granted, I have a habit of using get_post_meta and get_option instead of acf field functions, but there are places that I still use them and I’m not seeing any problem.
I think that the main difference, and this is only a guess, is that I did not export my field groups and then put them into the functions.php file. I wanted to put the same fields on every site, but I wanted the fields to remain editable. I also did not want anyone that had the ability to work on any of the sites to be able to edit the field groups. So what I did was use the local acf JSON feature of ACF5.
What I have is one theme set up for the main site that is not available for the other sites, to do this you network activate the them then activate in on the main site and then network deactivate it. I then created a plugin that switches to the main site and loads all of the field groups for the main whatever site is being loaded. I honestly don’t know why this would be different that adding code to functions.php, but since it’s the only difference? Or maybe it has something to do with being in a plugin?
Anyway, if anyone is interested I put a copy of this plugin up on GitHub
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!
Are you building WordPress sites with ACF and @BeaverBuilder, and wanted to use your ACF Blocks in both the block editor and Beaver Builder?— Advanced Custom Fields (@wp_acf) May 10, 2023
The BB team recently added support for using ACF Blocks in Beaver Builder. Check it out 👇https://t.co/UalEIa5aQi
© 2023 Advanced Custom Fields.