I have a WordPress multisite, and I created a plugin to share WooCommerce’s product with a child website by changing the global variables ($wpdb) values when the URL has the post_type=product argument.
Everything is working fine except the media library. I can set product image from the main site. But is not displaying in the child and no images are listing in the media library pop up, and I am getting errors when I try to upload a new image.
My code is below.
$wpdb->links='wp_links';
$wpdb->postmeta='wp_postmeta';
$wpdb->posts='wp_posts';
$wpdb->terms='wp_terms';
$wpdb->term_taxonomy='wp_term_taxonomy';
$wpdb->term_relationships='wp_term_relationships';
$wpdb->categories='wp_categories';`