This class shows how to copy a file from one site to other sites within the same WordPress multisite network. This code uses wp_handle_sideload() to copy the file to all the sites on the network without attaching them to posts. If you DO want to attach the file to a post when it is sideloaded, you may want to consider using media_sideload_image() instead.

Leave a reply

Your email address will not be published. Required fields are marked *