Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/upgrade.php

    r12258 r11958  
    163163                                                                'post_date' => $now,
    164164                                                                'post_date_gmt' => $now_gmt,
    165                                                                 'post_content' => sprintf(__('
    166 Welcome to WordPress!  This post contains important information.  After you read it, you can make it private to hide it from visitors but still have the information handy for future reference.
    167 
    168 First things first:
    169 <ul>
    170 <li><a href="%1$s" title="Subscribe to the WordPress mailing list for Release Notifications">Subscribe to the WordPress mailing list for release notifications</a></li>
    171 </ul>
    172 As a subscriber, you will receive an email every time an update is available (and only then).  This will make it easier to keep your site up to date, and secure from evildoers.
    173 When a new version is released, <a href="%2$s" title="If you are already logged in, this will take you directly to the Dashboard">log in to the Dashboard</a> and follow the instructions.
    174 Upgrading is a couple of clicks!
    175 
    176 Then you can start enjoying the WordPress experience:
    177 <ul>
    178 <li>Edit your personal information at <a href="%3$s" title="Edit settings like your password, your display name and your contact information">Users &#8250; Your Profile</a></li>
    179 <li>Start publishing at <a href="%4$s" title="Create a new post">Posts &#8250; Add New</a> and at <a href="%5$s" title="Create a new page">Pages &#8250; Add New</a></li>
    180 <li>Browse and install plugins at <a href="%6$s" title="Browse and install plugins at the official WordPress repository directly from your Dashboard">Plugins &#8250; Add New</a></li>
    181 <li>Browse and install themes at <a href="%7$s" title="Browse and install themes at the official WordPress repository directly from your Dashboard">Appearance &#8250; Add New Themes</a></li>
    182 <li>Modify and prettify your website&#8217;s links at <a href="%8$s" title="For example, select a link structure like: http://example.com/1999/12/post-name">Settings &#8250; Permalinks</a></li>
    183 <li>Import content from another system or WordPress site at <a href="%9$s" title="WordPress comes with importers for the most common publishing systems">Tools &#8250; Import</a></li>
    184 <li>Find answers to your questions at the <a href="%10$s" title="The official WordPress documentation, maintained by the WordPress community">WordPress Codex</a></li>
    185 </ul>
    186 To keep this post for reference, <a href="%11$s" title="Click to edit the content and settings of this post">click to edit it</a>, go to the Publish box and change its Visibility from Public to Private.
    187 
    188 Thank you for selecting WordPress.  We wish you happy publishing!
    189 
    190 PS.  Not yet subscribed for update notifications?  <a href="%1$s" title="Subscribe to the WordPress mailing list for Release Notifications">Do it now!</a>
    191 '), esc_attr_x('http://wordpress.org/download/','url for release notification mailing list subscription.'), admin_url(''), admin_url('profile.php'), admin_url('post-new.php'), admin_url('page-new.php'),
    192 admin_url('plugin-install.php'), admin_url('theme-install.php'), admin_url('options-permalink.php'), admin_url('import.php'), esc_attr_x('http://codex.wordpress.org','url for codex documentation.'), admin_url('post.php?action=edit&post=1')),
     165                                                                'post_content' => __('Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!'),
    193166                                                                'post_excerpt' => '',
    194                                                                 'post_title' => __('Welcome!'),
     167                                                                'post_title' => __('Hello world!'),
    195168                                                                /* translators: Default post slug */
    196                                                                 'post_name' => _x('welcome', 'Default post slug'),
     169                                                                'post_name' => _x('hello-world', 'Default post slug'),
    197170                                                                'post_modified' => $now,
    198171                                                                'post_modified_gmt' => $now_gmt,
     
    17131686        global $wp_current_db_version, $wp_db_version, $wpdb;
    17141687
    1715         // Upgrade 2.9 development versions
    1716         if ( ( $wp_current_db_version >= 11557 ) && ( $wp_current_db_version < 12217 ) ) {
    1717                 // Drop the option_id index. dbDelta() doesn't do the drop.
    1718                 $wpdb->query("ALTER TABLE $wpdb->options DROP INDEX option_id");
    1719 
    1720                 // Drop the old primary key and add the new.
    1721                 $wpdb->query("ALTER TABLE $wpdb->options DROP PRIMARY KEY, ADD PRIMARY KEY(option_id)");
    1722 
     1688        // Only run if less than 2.9
     1689        if ( $wp_current_db_version >= 11557 )
    17231690                return;
    1724         }
    1725 
    1726         // Upgrade versions prior to 2.9
    1727         if ( $wp_current_db_version < 11557 ) {
    1728                 // Delete duplicate options.  Keep the option with the highest option_id.
    1729                 $delete_options = $wpdb->get_col("SELECT o1.option_id FROM $wpdb->options AS o1 JOIN $wpdb->options AS o2 ON o2.option_name = o1.option_name AND o2.option_id > o1.option_id");
    1730                 if ( !empty($delete_options) ) {
    1731                         $delete_options = implode(',', $delete_options);
    1732                         $wpdb->query("DELETE FROM $wpdb->options WHERE option_id IN ($delete_options)");
    1733                 }
    1734 
    1735                 // Drop the old primary key and add the new.
    1736                 $wpdb->query("ALTER TABLE $wpdb->options DROP PRIMARY KEY, ADD PRIMARY KEY(option_id)");
    1737 
    1738                 // Drop the old option_name index. dbDelta() doesn't do the drop.
    1739                 $wpdb->query("ALTER TABLE $wpdb->options DROP INDEX option_name");
    1740         }
    1741 
     1691
     1692        // Delete duplicate options.  Keep the option with the highest option_id.
     1693        $delete_options = $wpdb->get_col("SELECT o1.option_id FROM $wpdb->options AS o1 JOIN $wpdb->options AS o2 ON o2.option_name = o1.option_name AND o2.option_id > o1.option_id");
     1694        if ( !empty($delete_options) ) {
     1695                $delete_options = implode(',', $delete_options);
     1696                $wpdb->query("DELETE FROM $wpdb->options WHERE option_id IN ($delete_options)");
     1697        }
     1698
     1699        // Add an index on option_id to satisfy the auto_increment requirement
     1700        $wpdb->query("ALTER TABLE $wpdb->options ADD INDEX option_id (option_id)");
     1701
     1702        // Drop the old primary key. The new primary will be created by dbDelta()
     1703        $wpdb->query("ALTER TABLE $wpdb->options DROP PRIMARY KEY");
     1704
     1705        // Drop the old option_name index. dbDelta() doesn't do the drop.
     1706        $wpdb->query("ALTER TABLE $wpdb->options DROP INDEX option_name");
    17421707}
    17431708
Note: See TracChangeset for help on using the changeset viewer.