クラス wpdb::tables()
クラス wpdb::tables()
定義ファイル :/blog/wp-includes/wp-db.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | public function tables( $scope = 'all', $prefix = true, $blog_id = 0 ) { switch ( $scope ) { case 'all' : $tables = array_merge( $this->global_tables, $this->tables ); if ( is_multisite() ) $tables = array_merge( $tables, $this->ms_global_tables ); break; case 'blog' : $tables = $this->tables; break; case 'global' : $tables = $this->global_tables; if ( is_multisite() ) $tables = array_merge( $tables, $this->ms_global_tables ); break; case 'ms_global' : $tables = $this->ms_global_tables; break; case 'old' : $tables = $this->old_tables; break; default : return array(); } if ( $prefix ) { if ( ! $blog_id ) $blog_id = $this->blogid; $blog_prefix = $this->get_blog_prefix( $blog_id ); $base_prefix = $this->base_prefix; $global_tables = array_merge( $this->global_tables, $this->ms_global_tables ); foreach ( $tables as $k => $table ) { if ( in_array( $table, $global_tables ) ) $tables[ $table ] = $base_prefix . $table; else $tables[ $table ] = $blog_prefix . $table; unset( $tables[ $k ] ); } if ( isset( $tables['users'] ) && defined( 'CUSTOM_USER_TABLE' ) ) $tables['users'] = CUSTOM_USER_TABLE; if ( isset( $tables['usermeta'] ) && defined( 'CUSTOM_USER_META_TABLE' ) ) $tables['usermeta'] = CUSTOM_USER_META_TABLE; } return $tables; } |