Hey there,
I set up a multisite with toolset and at the moment it is working fine, but the customer wants to be able to creat a blog post on one of the networks website and copy / clone it to other websites of the multisite network. I found this plugin: hidden link which worked fine at the start, but now it does not copy the Toolset fields anymore. So if checkboxes are selected in the first post, those are not selected in the copied post. The fields have the same naming on all sites. Is there anything how you could help me with that or any function within Toolset that could help me out? I cant find the solution for this problem.
Hello, I am not really familiar with this specific plugin and there is no direct integration with Types, so I don't have much information available for you. The Types field PHP API does not function across networked sites, it only allows you to render custom field values from the current site.
- Have you asked their support team for assistance with a feature that once worked but has suddenly stopped working? Do they have any additional information available about why the feature stopped working?
- If the plugin implements the REST API, you may need to expose each custom post type to the REST API to enable the plugin to access that CPT for cloning purposes. You can enable REST API connections for a CPT in Toolset > Post Types. Edit the CPT you want to enable, and open the Options panel. Turn on the show_in_rest option and save the post type settings.
You may also need to expose custom fields to the REST API. You can do that in Toolset > Settings > Custom Content. Check the checkbox for "Expose custom fields managed by Types for posts, users, and terms through the REST API" and save the settings.
- To access Types custom field values in the database, you must use the wpcf- slug prefix. If their plugin uses get_post_meta() to get custom field values, any Types field slugs in get_post_meta calls must include the wpcf- slug prefix. So if the Types custom field slug in wp-admin is address, then you would access that field like so:
get_post_meta($post_id, 'wpcf-address', true);
Those are the main things I can think of. I think the other plugin's support team is better qualified to tell you why their system suddenly stopped working as expected. I'm just guessing, unfortunately, and I don't have any truly useful information about their plugin.
Hey Christian,
as I am working with Blocks, the Rest API setting was already enabled for post types, but I enabled the Rest API for custom fields and it seems this did do the trick. At the moment the plugin clones posts as it should.
Thanks a lot for your help!
Hey there,
unfortunately that works fine for one of the post types, but does not work for another. So for me it seems, there has to be a problem within Toolset, if the other plugin works fine with one post type, but not with another?
You can see all post types here (green works with copier, red does not):
hidden link
I checked all settings and all have the REST_API enabled and the custom fields have all the same slugs on all sites of the network.