I got a question. First, sorry for my bad english, hope you understand what I want.
I create a WordPress Theme with a custom PageBuilder using ACF flexible content. So far so good. Is all working fine. Usually I store my fields in a json file in themefolder and user has to sync it once the theme is installed.
What I want:
I’m always using own Plugins to implement Posttypes, Widgets etc. Now I want to build a Plugin with extensions for my inTheme PageBuilder, so the user see more options when he builds a new page and the Plugin is activated.
Has anybody an idea how to realize that?This would be awsome, great, perfect.
Create layouts as arrays in PHP. You can do this by creating the layout in a field group and exporting it to php. Then copy the array for just the layout that you want to add.
Use the hook acf/validate_field_group. This hook fire no matter where the field group is loaded from (db or json). In your filter, merge the new layout into the field group containing all the other layouts.
This could likely also be done with JSON files if you json encode just the layout array for each layout. You’d need to build your own code to load these layout json files.
thank your very much. This brought me some steps further. But I#m not the best PHP Developer so I don’t really know how to “merge” the export (PHP/JSON) into the existing fields coming with my theme. I really prefer JSON, but it’s not a must have.
Maybe you have a CodeSnippet how I can realize this last step? If it’s not part of your services as a supportmember, maybe we can connect on a personal way and you tell me what i have to pay for your help?