I am working on a Multisite project.

Overview: We are creating the content/posts on main site using Visual Composer page builder plugin and then cloning that post across all sub site using a cloner plugin.

Problem: Suppose that we have created a post with ID 10 and in Visual Composer I am using an image component and inserting two images ( attachment ) with ID 15 and 18 . If I cloned the post across all multisite, the posts are cloned correctly but the images are breaking because the image being cloned doesn't always have the same ID throughout the sub-site.

What I need: I need a solution where I need only one MEDIA LIBRARY (databse ) and all sites and subsites will use images from that media library.

What I have done till now I have tried many plugins but none of them meets my requirement. Some plugins are synchronising the image through all sub-site but not giving the same image id through all subsite.

Searching : Checking core code and finding hooks where we can change the table name when we are fetching the images and displaying in MEDIA library. There we can change the table to always use the main site posts table for fetching the attachment in Media Library.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.