Repository navigation
Multisite Replaced By Same Posts Database #175
|
I have everything set up working correctly with the below. It's multisite and the second database is a standard WP setup. The function successfully connects the root multisite with the second posts and postmeta database. How do I replace all the multisite post and postmeta with the same standard WP post and postmeta database table? global $wpdb; |
Replies: 2 comments 2 replies
|
I figured out a solution..... I added Next question, is there a way to only partition post_type=product and the corresponding postmeta? |
|
Please revert the edit to Routing only The safe boundary is the complete table pair (usually the complete site table set), not selected rows from those tables. If the goal is shared products across sites, use a purpose-built multisite product-sharing layer or a synchronization/indexing design rather than rewriting core database queries. |
Please revert the edit to
LudicrousDB::query(). Rewriting every multisite table prefix inside the database class bypasses normal routing and will be overwritten on upgrade. More importantly, making every site use onepostsandpostmetapair collapses WordPress's site-level table isolation; IDs, schema upgrades, plugin assumptions, and writes can collide.Routing only
post_type = productrows is not a safe LudicrousDB partition either. LudicrousDB selects a database connection for a table/query; it does not split rows withinposts. Many reads do not include apost_typecondition, and product metadata lives inpostmeta, where the type is not known without joining back toposts.The safe bou…