[wp-hackers] Multisite options

Mike Burns mike at grady-etc.com
Mon Jan 20 20:32:07 UTC 2014


> Now, into the mix, I now have the information from my particular client.
> In his situation, his constants (when read from a plugin page on the  
> network dashboard, on WordPress 3.8) are as follows (this is what he's  
> sent me):
> MULTISITE: (undefined)
> SUBDOMAIN_INSTALL: (undefined)
> VHOST: no
> SUNRISE: on
>  
Those look like typical settings from a WPMU-era wp-config.php.  The logic you mention in `get_blog_prefix()` ensures that the main blog prefix is `wp_1_` for WPMU-era installs and `wp_` for WP 3.0+ installs.  It does not, however, appropriately handle a `$blog_id` of 0 for this configuration as you have discovered.

You can file it as a bug, but I still maintain my original opinion that `get_blog_prefix()` isn’t the method you should be using.  I defer to core devs for an “officially sanctioned” method for retrieving the base prefix — I don’t see one.  Seems like a `get_table_prefix()` or `get_base_prefix()` method for the `wpdb` class would be more appropriate.


More information about the wp-hackers mailing list