I’m embarking on a large multisite installation where each site is almost identical, except for the layouts of the page (let’s assume I’m using elementor to build the pages)
I want lots of custom fields through the site, however adding and updating fields later on across possibly hundreds of sites would be impossible to manage.
Normally I would use something like CMB2, where I can program all the fields in a functions file which populated through the multisite as they all use the same functions file.
I’d like to use toolset on this project, however I can’t seem to see if there’s a way of programmatically creating custom fields on a global scale without having to manually create them in each separate site of the network.
IS this possible? Even if it’s a custom function I would need to write and run a for each loop over each blog to update the tables and have it show inside the types admin?
Hi, unfortunately there's no public API for programmatically creating Types custom fields. However, there are two other options that could make things a bit easier for you:
1. The Module Manager is designed to allow you to bundle custom fields, templates, views, custom taxonomies, and so forth. Compile those components into Modules, then install that same Module on multiple sites.
2. The Toolset import/export tool can be used to export an XML document of your Types settings. This will include the custom field groups, custom post types, custom taxonomies, and so forth. This file is editable, so in theory you could customize which of those elements you want to import in other sites.
If you'd like to see this type of API added to the software, I encourage you to submit a request here: https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
This will put your request in front of key decision makers who influence upcoming features.