[wp-trac] [WordPress Trac] #13633: multisite prefixes

WordPress Trac wp-trac at lists.automattic.com
Sun May 30 00:55:04 UTC 2010


#13633: multisite prefixes
--------------------------+-------------------------------------------------
 Reporter:  Angeloverona  |       Owner:  ryan                  
     Type:  enhancement   |      Status:  new                   
 Priority:  normal        |   Milestone:  3.0                   
Component:  Database      |     Version:  3.0                   
 Severity:  normal        |    Keywords:  wpdb, prefix, prefixes
--------------------------+-------------------------------------------------
 since WordPress is multiblog site, we have still only one prefix function
 like "wpdb->prefix;" for now we have many blogs with unique prefixes... in
 modules we can easily use this "wpdb->prefix; to get unique prefix of
 active site...but how can we get a primary prefix for main blog in
 modules? i have funtion like:

 substr($wpdb->prefix, 0, stripos($wpdb->prefix, "_")+1);

 but this can be used only if prefix look like as "cars_", if someone use
 prefix like "my_cars_" this method will fail.

 it will be good to enhance this prefixes like get prefix by id, or more
 simply get base prefix.
 $wpdb[0]->prefix,$wpdb->prefix_id,$wpdb->base_prefix

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13633>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list