]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/upgrade.php
WordPress 4.7
[autoinstalls/wordpress.git] / wp-admin / includes / upgrade.php
index 807673a7f0b9a0cc9053f29280c15211d72469c1..94a122509cca94aae445c8fe87316321d5fd4522 100644 (file)
@@ -50,6 +50,9 @@ function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated
        update_option('admin_email', $user_email);
        update_option('blog_public', $public);
 
+       // Freshness of site - in the future, this could get more specific about actions taken, perhaps.
+       update_option( 'fresh_site', 1 );
+
        if ( $language ) {
                update_option( 'WPLANG', $language );
        }
@@ -161,12 +164,12 @@ function wp_install_defaults( $user_id ) {
                }
 
                $first_post = sprintf( $first_post,
-                       sprintf( '<a href="%s">%s</a>', esc_url( network_home_url() ), get_current_site()->site_name )
+                       sprintf( '<a href="%s">%s</a>', esc_url( network_home_url() ), get_network()->site_name )
                );
 
                // Back-compat for pre-4.4
                $first_post = str_replace( 'SITE_URL', esc_url( network_home_url() ), $first_post );
-               $first_post = str_replace( 'SITE_NAME', get_current_site()->site_name, $first_post );
+               $first_post = str_replace( 'SITE_NAME', get_network()->site_name, $first_post );
        } else {
                $first_post = __( 'Welcome to WordPress. This is your first post. Edit or delete it, then start writing!' );
        }
@@ -253,8 +256,7 @@ As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d
        update_option( 'widget_archives', array ( 2 => array ( 'title' => '', 'count' => 0, 'dropdown' => 0 ), '_multiwidget' => 1 ) );
        update_option( 'widget_categories', array ( 2 => array ( 'title' => '', 'count' => 0, 'hierarchical' => 0, 'dropdown' => 0 ), '_multiwidget' => 1 ) );
        update_option( 'widget_meta', array ( 2 => array ( 'title' => '' ), '_multiwidget' => 1 ) );
-       update_option( 'sidebars_widgets', array ( 'wp_inactive_widgets' => array (), 'sidebar-1' => array ( 0 => 'search-2', 1 => 'recent-posts-2', 2 => 'recent-comments-2', 3 => 'archives-2', 4 => 'categories-2', 5 => 'meta-2', ), 'array_version' => 3 ) );
-
+       update_option( 'sidebars_widgets', array( 'wp_inactive_widgets' => array(), 'sidebar-1' => array( 0 => 'search-2', 1 => 'recent-posts-2', 2 => 'recent-comments-2', 3 => 'archives-2', 4 => 'categories-2', 5 => 'meta-2' ), 'sidebar-2' => array(), 'sidebar-3' => array(), 'array_version' => 3 ) );
        if ( ! is_multisite() )
                update_user_meta( $user_id, 'show_welcome_panel', 1 );
        elseif ( ! is_super_admin( $user_id ) && ! metadata_exists( 'user', $user_id, 'show_welcome_panel' ) )
@@ -373,6 +375,7 @@ function wp_new_blog_notification($blog_title, $blog_url, $user_id, $password) {
        $email = $user->user_email;
        $name = $user->user_login;
        $login_url = wp_login_url();
+       /* translators: New site notification email. 1: New site URL, 2: User login, 3: User password or password reset link, 4: Login URL */
        $message = sprintf( __( "Your new WordPress site has been successfully set up at:
 
 %1\$s
@@ -2283,7 +2286,7 @@ function dbDelta( $queries = '', $execute = true ) {
                                        $index_type = str_replace( 'INDEX', 'KEY', $index_type );
 
                                        // Escape the index name with backticks. An index for a primary key has no name.
-                                       $index_name = ( 'PRIMARY KEY' === $index_type ) ? '' : '`' . $index_matches['index_name'] . '`';
+                                       $index_name = ( 'PRIMARY KEY' === $index_type ) ? '' : '`' . strtolower( $index_matches['index_name'] ) . '`';
 
                                        // Parse the columns. Multiple columns are separated by a comma.
                                        $index_columns = array_map( 'trim', explode( ',', $index_matches['index_columns'] ) );
@@ -2407,7 +2410,7 @@ function dbDelta( $queries = '', $execute = true ) {
                        foreach ($tableindices as $tableindex) {
 
                                // Add the index to the index data array.
-                               $keyname = $tableindex->Key_name;
+                               $keyname = strtolower( $tableindex->Key_name );
                                $index_ary[$keyname]['columns'][] = array('fieldname' => $tableindex->Column_name, 'subpart' => $tableindex->Sub_part);
                                $index_ary[$keyname]['unique'] = ($tableindex->Non_unique == 0)?true:false;
                                $index_ary[$keyname]['index_type'] = $tableindex->Index_type;
@@ -2418,7 +2421,7 @@ function dbDelta( $queries = '', $execute = true ) {
 
                                // Build a create string to compare to the query.
                                $index_string = '';
-                               if ($index_name == 'PRIMARY') {
+                               if ($index_name == 'primary') {
                                        $index_string .= 'PRIMARY ';
                                } elseif ( $index_data['unique'] ) {
                                        $index_string .= 'UNIQUE ';
@@ -2430,7 +2433,7 @@ function dbDelta( $queries = '', $execute = true ) {
                                        $index_string .= 'SPATIAL ';
                                }
                                $index_string .= 'KEY ';
-                               if ( 'PRIMARY' !== $index_name  ) {
+                               if ( 'primary' !== $index_name  ) {
                                        $index_string .= '`' . $index_name . '`';
                                }
                                $index_columns = '';
@@ -2821,7 +2824,7 @@ function pre_schema_upgrade() {
        // Multisite schema upgrades.
        if ( $wp_current_db_version < 25448 && is_multisite() && wp_should_upgrade_global_tables() ) {
 
-               // Upgrade verions prior to 3.7
+               // Upgrade versions prior to 3.7
                if ( $wp_current_db_version < 25179 ) {
                        // New primary key for signups.
                        $wpdb->query( "ALTER TABLE $wpdb->signups ADD signup_id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST" );