WordPress Multisite – Questions about select all posts from all network sites

To iterate through all sites of the network, we need a function like this (it’s an adaptation, check the original that’s linked there too):

Hierarchical Page Listing of all Pages in a Multisite Network

And when doing the loop, you will switch_to_blog($id) and perform any normal read/write operation. Here’s an example of post insertion after a site creation:

WP_INSERT_POST issue on WordPress Multisite

And here’s an experimental plugin I did to publish a post from one site to another. It displays a meta box when editing a post where you can select other site where the same post is to be published. I guess it’s a good starting point to develop a custom solution.

tech