~ubuntu-branches/debian/jessie/wordpress/jessie

« back to all changes in this revision

Viewing changes to wp-admin/includes/upgrade.php

  • Committer: Package Import Robot
  • Author(s): Craig Small
  • Date: 2014-04-17 20:56:19 UTC
  • mfrom: (1.2.35)
  • Revision ID: package-import@ubuntu.com-20140417205619-nurbet6eho4yvwfv
Tags: 3.9+dfsg-1
* New upstream release
* 3.9 seems to handle different locations for plugins so the
  plugin directory handling patches have been cut back.

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
 
87
87
        wp_cache_flush();
88
88
 
 
89
        /**
 
90
         * Fires after a site is fully installed.
 
91
         *
 
92
         * @since 3.9.0
 
93
         *
 
94
         * @param WP_User $user The site owner.
 
95
         */
 
96
        do_action( 'wp_install', $user );
 
97
 
89
98
        return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message);
90
99
}
91
100
endif;
161
170
 
162
171
        // Default comment
163
172
        $first_comment_author = __('Mr WordPress');
164
 
        $first_comment_url = 'http://wordpress.org/';
 
173
        $first_comment_url = 'https://wordpress.org/';
165
174
        $first_comment = __('Hi, this is a comment.
166
175
To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.');
167
176
        if ( is_multisite() ) {
273
282
We hope you enjoy your new site. Thanks!
274
283
 
275
284
--The WordPress Team
276
 
http://wordpress.org/
 
285
https://wordpress.org/
277
286
"), $blog_url, $name, $password);
278
287
 
279
288
        @wp_mail($email, __('New WordPress Site'), $message);
317
326
                else
318
327
                        $wpdb->query( "INSERT INTO {$wpdb->blog_versions} ( `blog_id` , `db_version` , `last_updated` ) VALUES ( '{$wpdb->blogid}', '{$wp_db_version}', NOW());" );
319
328
        }
 
329
 
 
330
        /**
 
331
         * Fires after a site is fully upgraded.
 
332
         *
 
333
         * @since 3.9.0
 
334
         *
 
335
         * @param int $wp_db_version         The new $wp_db_version.
 
336
         * @param int $wp_current_db_version The old (current) $wp_db_version.
 
337
         */
 
338
        do_action( 'wp_upgrade', $wp_db_version, $wp_current_db_version );
320
339
}
321
340
endif;
322
341
 
411
430
        if ( $wp_current_db_version < 26691 )
412
431
                upgrade_380();
413
432
 
414
 
        if ( $wp_current_db_version < 26692 )
415
 
                upgrade_383();
416
 
 
417
433
        maybe_disable_link_manager();
418
434
 
419
435
        maybe_disable_automattic_widgets();
1254
1270
                deactivate_plugins( array( 'mp6/mp6.php' ), true );
1255
1271
        }
1256
1272
}
1257
 
 
1258
 
/**
1259
 
 * Execute changes made in WordPress 3.8.3.
1260
 
 *
1261
 
 * @since 3.8.3
1262
 
 */
1263
 
function upgrade_383() {
1264
 
        global $wp_current_db_version, $wpdb;
1265
 
        if ( $wp_current_db_version < 26692 ) {
1266
 
                // Find all lost Quick Draft auto-drafts and promote them to proper drafts.
1267
 
                $posts = $wpdb->get_results( "SELECT ID, post_title, post_content FROM $wpdb->posts WHERE post_type = 'post'
1268
 
                        AND post_status = 'auto-draft' AND post_date >= '2014-04-08 00:00:00'" );
1269
 
 
1270
 
                foreach ( $posts as $post ) {
1271
 
                        // A regular auto-draft should never have content as that would mean it should have been promoted.
1272
 
                        // If an auto-draft has content, it's from Quick Draft and it should be recovered.
1273
 
                        if ( '' === $post->post_content ) {
1274
 
                                // If it does not have content, we must evaluate whether the title should be recovered.
1275
 
                                if ( 'Auto Draft' === $post->post_title || __( 'Auto Draft' ) === $post->post_title ) {
1276
 
                                        // This a plain old auto draft. Ignore it.
1277
 
                                        continue;
1278
 
                                }
1279
 
                        }
1280
 
 
1281
 
                        $wpdb->update( $wpdb->posts, array( 'post_status' => 'draft' ), array( 'ID' => $post->ID ) );
1282
 
                        clean_post_cache( $post->ID );
1283
 
                }
1284
 
        }
1285
 
}
1286
 
 
1287
1273
/**
1288
1274
 * Execute network level changes
1289
1275
 *
1569
1555
                $queries = explode( ';', $queries );
1570
1556
                $queries = array_filter( $queries );
1571
1557
        }
 
1558
        
 
1559
        /** 
 
1560
         * Filter the dbDelta SQL queries.
 
1561
         *
 
1562
         * @since 3.3.0
 
1563
         *
 
1564
         * @param array $queries An array of dbDelta SQL queries.
 
1565
         */
1572
1566
        $queries = apply_filters( 'dbdelta_queries', $queries );
1573
1567
 
1574
1568
        $cqueries = array(); // Creation Queries
1590
1584
                        // Unrecognized query type
1591
1585
                }
1592
1586
        }
 
1587
        
 
1588
        /** 
 
1589
         * Filter the dbDelta SQL queries for creating tables and/or databases.
 
1590
         *
 
1591
         * Queries filterable via this hook contain "CREATE TABLE" or "CREATE DATABASE".
 
1592
         * 
 
1593
         * @since 3.3.0
 
1594
         *
 
1595
         * @param array $cqueries An array of dbDelta create SQL queries.
 
1596
         */
1593
1597
        $cqueries = apply_filters( 'dbdelta_create_queries', $cqueries );
 
1598
 
 
1599
        /** 
 
1600
         * Filter the dbDelta SQL queries for inserting or updating.
 
1601
         *
 
1602
         * Queries filterable via this hook contain "INSERT INTO" or "UPDATE".
 
1603
         * 
 
1604
         * @since 3.3.0
 
1605
         *
 
1606
         * @param array $iqueries An array of dbDelta insert or update SQL queries.
 
1607
         */
1594
1608
        $iqueries = apply_filters( 'dbdelta_insert_queries', $iqueries );
1595
1609
 
1596
1610
        $global_tables = $wpdb->tables( 'global' );