set_blog_id() 공개 메소드

Sets blog id.
부터: 3.0.0
public set_blog_id ( integer $blog_id, integer $site_id ) : string
$blog_id integer
$site_id integer Optional.
리턴 string previous blog id
예제 #1
0
 /**
  * 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);
 }
예제 #2
0
파일: Backup.php 프로젝트: jimrucinski/Vine
 /**
  * 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());
             }
         }
     }
 }