plugins – Best method of implementing compartmentalized custom post types on a multi-site network


I’m aware that there are many different ways to implement custom post types on a multi-site network, however, I’m unsure as to the best method to do so for my application. I have a website with multiple subdomains that are only accessible by users with specific user roles. Each subdomain will have a set of custom post types that the users can create and edit from a front end dashboard, but I need many of them to be accessible on the main website without adding the subdomain to the URL. I can either use a broadcast plugin to accomplish this or I can use the save_post hook to duplicate the information on the main website. The issue still remains on the method of registering the custom post types.

Since the users would not have access to the admin dashboard, would it be better to write a network plugin that creates all the custom post types at once, but only does so on the sites where the ID matches a hard coded parameter for each custom post type, or should I write multiple plugins that handle the custom post types for each blog, install them on the network, and only activate them for the relevant subdomains? Or is there a better method that I’m unaware of?

Ryan Cochran 2 years 2022-04-30T21:29:58-05:00 0 Answers 0 views 0

Leave an answer