|
2 | 2 | /**
|
3 | 3 | * WordPress core upgrade functionality.
|
4 | 4 | *
|
| 5 | + * Note: newly introduced functions and methods cannot be used here. |
| 6 | + * All functions must be present in both the previous version being upgraded from, |
| 7 | + * and the later version that's being installed (e.g. when rolling back Core) |
| 8 | + * as this file is used in both. |
| 9 | + * |
5 | 10 | * @package WordPress
|
6 | 11 | * @subpackage Administration
|
7 | 12 | * @since 2.7.0
|
@@ -1539,12 +1544,12 @@ function update_core( $from, $to ) {
|
1539 | 1544 | *
|
1540 | 1545 | * @global array $_old_requests_files Requests files to be preloaded.
|
1541 | 1546 | * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
|
| 1547 | + * @global string $wp_version The WordPress version string. |
1542 | 1548 | *
|
1543 | 1549 | * @param string $to Path to old WordPress installation.
|
1544 | 1550 | */
|
1545 | 1551 | function _preload_old_requests_classes_and_interfaces( $to ) {
|
1546 |
| - global $_old_requests_files, $wp_filesystem; |
1547 |
| - $wp_version = wp_get_wp_version(); |
| 1552 | + global $_old_requests_files, $wp_filesystem, $wp_version; |
1548 | 1553 |
|
1549 | 1554 | /*
|
1550 | 1555 | * Requests was introduced in WordPress 4.6.
|
@@ -1587,14 +1592,14 @@ function _preload_old_requests_classes_and_interfaces( $to ) {
|
1587 | 1592 | *
|
1588 | 1593 | * @since 3.3.0
|
1589 | 1594 | *
|
1590 |
| - * @global string $pagenow The filename of the current screen. |
| 1595 | + * @global string $wp_version The WordPress version string. |
| 1596 | + * @global string $pagenow The filename of the current screen. |
1591 | 1597 | * @global string $action
|
1592 | 1598 | *
|
1593 | 1599 | * @param string $new_version
|
1594 | 1600 | */
|
1595 | 1601 | function _redirect_to_about_wordpress( $new_version ) {
|
1596 |
| - global $pagenow, $action; |
1597 |
| - $wp_version = wp_get_wp_version(); |
| 1602 | + global $wp_version, $pagenow, $action; |
1598 | 1603 |
|
1599 | 1604 | if ( version_compare( $wp_version, '3.4-RC1', '>=' ) ) {
|
1600 | 1605 | return;
|
|
0 commit comments