/** * Sets blog id. * * @since 3.0.0 * @access public * @param int $blog_id * @param int $site_id Optional. * @return string previous blog id */ function set_blog_id($blog_id, $site_id = 0) { $this->fields_map = new Fields_map($blog_id); return parent::set_blog_id($blog_id, $site_id); }
/** * Reconnects to database to avoid timeout problem after ZIP files. * * @return void */ public function wpdb_reconnect() { /** @var wpdb $wpdb */ global $wpdb; if (is_callable(array($wpdb, 'check_connection'))) { $wpdb->check_connection(); return; } if (class_exists('wpdb') && function_exists('wp_set_wpdb_vars')) { @mysql_close($wpdb->dbh); /** @handled class */ $wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST); wp_set_wpdb_vars(); if (function_exists('is_multisite')) { if (is_multisite()) { $wpdb->set_blog_id(get_current_blog_id()); } } } }