Multisite Replaced By Same Posts Database #175
Unanswered
allcalmarketing
asked this question in
Help
Replies: 1 comment 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? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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;
$wpdb->add_callback( 'db_callback' );
function db_callback( $query, $wpdb ) {
if ( $wpdb->base_prefix . 'posts' == $wpdb->table || $wpdb->base_prefix . 'postmeta' == $wpdb->table ) {
return 'wpposts';
}
}
Beta Was this translation helpful? Give feedback.
All reactions