From 3a9d10480def498ea5734af9400b89f9b4ab0634 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Fri, 2 Apr 2010 22:47:51 +0000 Subject: [PATCH] have get_blog_prefix() default to the prefix of the current blog, see #12820 git-svn-id: https://develop.svn.wordpress.org/trunk@13949 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/wp-db.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 2ace3eb5ec..0f27d2cadf 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -624,8 +624,10 @@ class wpdb { * @param int $blog_id Optional. * @return string Blog prefix. */ - function get_blog_prefix( $blog_id = 0 ) { - if ( is_multisite() && $blog_id ) { + function get_blog_prefix( $blog_id = -1 ) { + if ( is_multisite() ) { + if ( $blog_id < 0 ) + $blog_id = $this->blogid; if ( defined( 'MULTISITE' ) && ( 0 == $blog_id || 1 == $blog_id ) ) return $this->base_prefix; else @@ -1577,4 +1579,4 @@ if ( ! isset($wpdb) ) { */ $wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST); } -?> \ No newline at end of file +?>