upgrade_network
函数
upgrade_network ( No parameters )
- 定义位置
-
-
wp-admin/includes/upgrade.php
, line 2296
-
wp-admin/includes/upgrade.php
- 引入
- 3.0.0
- 弃用
- –
Executes network-level upgrade routines.
function upgrade_network() {
global $wp_current_db_version, $wpdb;
// Always clear expired transients.
delete_expired_transients( true );
// 2.8.0
if ( $wp_current_db_version get_results( "SELECT meta_key, meta_value FROM {$wpdb->sitemeta} ORDER BY meta_id LIMIT $start, 20" ) ) {
foreach ( $rows as $row ) {
$value = $row->meta_value;
if ( ! @unserialize( $value ) ) {
$value = stripslashes( $value );
}
if ( $value !== $row->meta_value ) {
update_site_option( $row->meta_key, $value );
}
}
$start += 20;
}
}
// 3.0.0
if ( $wp_current_db_version $theme_data ) {
if ( isset( $allowed_themes[ $theme_data->get( 'Name' ) ] ) ) {
$converted[ $stylesheet ] = true;
}
}
update_site_option( 'allowedthemes', $converted );
delete_site_option( 'allowed_themes' );
}
}
// 3.5.0
if ( $wp_current_db_version charset ) {
if ( wp_should_upgrade_global_tables() ) {
$wpdb->query( "ALTER TABLE $wpdb->usermeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
$wpdb->query( "ALTER TABLE $wpdb->site DROP INDEX domain, ADD INDEX domain(domain(140),path(51))" );
$wpdb->query( "ALTER TABLE $wpdb->sitemeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
$wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain_path, ADD INDEX domain_path(domain(140),path(51))" );
$tables = $wpdb->tables( 'global' );
// sitecategories may not exist.
if ( ! $wpdb->get_var( "SHOW TABLES LIKE '{$tables['sitecategories']}'" ) ) {
unset( $tables['sitecategories'] );
}
foreach ( $tables as $table ) {
maybe_convert_table_to_utf8mb4( $table );
}
}
}
// 4.3.0
if ( $wp_current_db_version charset ) {
if ( wp_should_upgrade_global_tables() ) {
$upgrade = false;
$indexes = $wpdb->get_results( "SHOW INDEXES FROM $wpdb->signups" );
foreach ( $indexes as $index ) {
if ( 'domain_path' === $index->Key_name && 'domain' === $index->Column_name && 140 != $index->Sub_part ) {
$upgrade = true;
break;
}
}
if ( $upgrade ) {
$wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain_path, ADD INDEX domain_path(domain(140),path(51))" );
}
$tables = $wpdb->tables( 'global' );
// sitecategories may not exist.
if ( ! $wpdb->get_var( "SHOW TABLES LIKE '{$tables['sitecategories']}'" ) ) {
unset( $tables['sitecategories'] );
}
foreach ( $tables as $table ) {
maybe_convert_table_to_utf8mb4( $table );
}
}
}
// 5.1.0
if ( $wp_current_db_version
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。


