[wp-hackers] Cloning content from Master site into new sites on a WP Network

Jesse Friedman highfive at jesserfriedman.com
Wed Jul 11 18:56:00 UTC 2012


Hello All

What's the best way to grab posts, pages, CPT's from a Master (top level)
site in a WP Network and clone it into another site?

I've created a page template from wp-signup.php to alter the "Add New Blog"
form.  Now the form query's all the "Products" custom posts in the Master
Site and displays them as checkboxes.  The goal here is that when a new
site is added to the network a potential admin can select the products they
offer from a Master list of products and that content (currently existing
in the Master Site) will be duplicated into the new site.

My question is should I be using wp_insert_post().  Since I have the id's
of all the CPT's in the master site and the ones that the admin has
selected it'd be easy enough to loop through the info and use
wp_insert_post to insert the posts into the new site.  The problem is I
can't seem to define the site id of the new site with wp_insert_post().

thanks for the help

Jesse


More information about the wp-hackers mailing list