Multisite support or export in PHP

Hi,

I need to sync my (awesome) Tangibles templates in each site of a Worpdress multisite. Is there a way to do this : crossposting, export in PHP file, … ?

Best

Hi Guillaume, this thread might provide some info for you. The basic idea is that ultimately L&L templates are just posts, so any tool that allows you to manage syncing a custom post type between subsites should also work for L&L posts. There’s a native solution in the works, but since it’s a pretty sizeable project, it might be quite a while until that’s released. Maybe Distributor could work for you? I’m not sure how well it works with custom post types though. I’m sure there are other plugins for this too.

Hi Benjamin,

Thanks for your reply and your suggestion of Distributor. I didn’t know It, I’ll investigate on this gem.
At this time, I am using Simple Multisite Crossposting but it doesn’t work.
Can you confirm that Tangible template custom post type’s name is “tangible_template” and that custom fields are supported in it ?

No problem, I hope you find a tool that works for you! And yeah, I can confirm that’s the name Of the template post type. I’m not sure what you mean when you ask whether “custom fields are supported in it” though.

When I speak about custom fields support for tangible_template post type, I mean : does your post type definition as “custom-field” in supports parameter register_post_type() | Function | WordPress Developer Resources.
Actually I try to display a cross posting metabox in my tangible template post backend page but it doesn’t show. Actually, i tried with ACF to add some setting fields in my tangible template post but it doen’t show either.

Hi Guillaume,
It seems like we’re overriding the main post content area in the edit screen entirely, but I did notice I was able to add ACF field groups to the sidebar. With that information, I posited that if I enabled custom-fields support on the post type and then adjusted the metabox to display in the sidebar I could get this to work, and it did! Here’s my code (credit to ChatGPT for helping me out here):

// add custom field support to tangible template post type
function add_custom_field_support_to_tangible_template() {
	add_post_type_support( 'tangible_template', 'custom-fields' );
}

// move core custom fields interface to sidebar so that it actually renders
add_action( 'init', 'add_custom_field_support_to_tangible_template' );
function move_custom_fields_metabox_to_sidebar() {
	global $wp_meta_boxes;

	// Remove the core custom fields metabox from the normal position
	unset( $wp_meta_boxes['tangible_template']['normal']['custom-fields'] );

	// Add the core custom fields metabox back in the sidebar position
	add_meta_box( 'custom-fields', __( 'Custom Fields' ), 'post_custom_meta_box', 'tangible_template', 'side', 'core' );
}

add_action( 'add_meta_boxes', 'move_custom_fields_metabox_to_sidebar' );

The layout is a little wonky, but you could use the Screen Options 1 column layout to make the sidebar sit full width below the editor.

Let me know if that works for you!

That’s interesting, thanks Julia. I’ll investigate this option. :+1: