10up / MU-Migration

This WP-CLI plugin makes the process of moving sites from single WordPress sites to a Multisite instance (or vice-versa) much easier. It exports everything into a zip package which can be used to automatically import it within the desired Multisite installation.
MIT License
329 stars 47 forks source link

Use base_prefix rather than prefix when fetching db prefix for subsite #44

Closed andyzito closed 6 years ago

andyzito commented 6 years ago

Very small change -- use $wpdb->base_prefix instead of $wpdb->prefix when fetching database prefix for a subsite.

I found this when I was importing to a site where $wpdb->prefix returned wp_1_ instead of wp_ (on the main site). This may not be a common thing, but it still seems like slightly better practice to use base_prefix, since that's really what we're looking to concatenate with $blog_id . _

nicholasio commented 6 years ago

Makes sense, since we're always concatenating with the $blog_id ourselves, passing--url instead of --blog_id could potentially trigger this issue.