diff --git src/wp-admin/includes/upgrade.php src/wp-admin/includes/upgrade.php
index b72303a..325c7ed 100644
|
|
|
|
| 2 | 2 | /** |
| 3 | 3 | * WordPress Upgrade API |
| 4 | 4 | * |
| 5 | | * Most of the functions are pluggable and can be overwritten |
| | 5 | * Most of the functions are pluggable and can be overwritten. |
| 6 | 6 | * |
| 7 | 7 | * @package WordPress |
| 8 | 8 | * @subpackage Administration |
| … |
… |
require_once(ABSPATH . 'wp-admin/includes/schema.php');
|
| 20 | 20 | |
| 21 | 21 | if ( !function_exists('wp_install') ) : |
| 22 | 22 | /** |
| 23 | | * Installs the blog |
| | 23 | * Installs the blog. |
| 24 | 24 | * |
| 25 | | * {@internal Missing Long Description}} |
| | 25 | * Runs the required functions to set up and populate the database, |
| | 26 | * including primary admin user and initial options. |
| 26 | 27 | * |
| 27 | 28 | * @since 2.1.0 |
| 28 | 29 | * |
| … |
… |
endif;
|
| 108 | 109 | |
| 109 | 110 | if ( !function_exists('wp_install_defaults') ) : |
| 110 | 111 | /** |
| 111 | | * {@internal Missing Short Description}} |
| | 112 | * Creates the initial content for a newly-installed site. |
| 112 | 113 | * |
| 113 | | * {@internal Missing Long Description}} |
| | 114 | * Adds the default "Uncategorized" category, the first post (with comment), |
| | 115 | * first page, and default widgets for default theme for the current version. |
| 114 | 116 | * |
| 115 | 117 | * @since 2.1.0 |
| 116 | 118 | * |
| … |
… |
endif;
|
| 262 | 264 | |
| 263 | 265 | if ( !function_exists('wp_new_blog_notification') ) : |
| 264 | 266 | /** |
| 265 | | * {@internal Missing Short Description}} |
| | 267 | * Notify the site admin that the setup is complete. |
| 266 | 268 | * |
| 267 | | * {@internal Missing Long Description}} |
| | 269 | * Sends an email with {@link wp_mail} to the new administrator that the site |
| | 270 | * setup is complete, and provides them with a record of their login credentials. |
| 268 | 271 | * |
| 269 | 272 | * @since 2.1.0 |
| 270 | 273 | * |
| … |
… |
if ( !function_exists('wp_upgrade') ) :
|
| 302 | 305 | /** |
| 303 | 306 | * Run WordPress Upgrade functions. |
| 304 | 307 | * |
| 305 | | * {@internal Missing Long Description}} |
| | 308 | * Upgrades the database if needed during a site update. |
| 306 | 309 | * |
| 307 | 310 | * @since 2.1.0 |
| 308 | 311 | * |
| 309 | | * @return null |
| | 312 | * @return null If no update is necessary or site isn't completely installed. |
| 310 | 313 | */ |
| 311 | 314 | function wp_upgrade() { |
| 312 | 315 | global $wp_current_db_version, $wp_db_version, $wpdb; |
| … |
… |
endif;
|
| 351 | 354 | /** |
| 352 | 355 | * Functions to be called in install and upgrade scripts. |
| 353 | 356 | * |
| 354 | | * {@internal Missing Long Description}} |
| | 357 | * Contains conditional checks to determine which upgrade scripts to run, based on |
| | 358 | * database version and WP version we're updating to. |
| 355 | 359 | * |
| 356 | 360 | * @since 1.0.1 |
| | 361 | * |
| | 362 | * @return null If no update is necessary. |
| 357 | 363 | */ |
| 358 | 364 | function upgrade_all() { |
| 359 | 365 | global $wp_current_db_version, $wp_db_version; |
| … |
… |
function upgrade_370() {
|
| 1290 | 1296 | * Execute changes made in WordPress 3.7.2. |
| 1291 | 1297 | * |
| 1292 | 1298 | * @since 3.7.2 |
| 1293 | | * @since 3.8.0 |
| 1294 | 1299 | */ |
| 1295 | 1300 | function upgrade_372() { |
| 1296 | 1301 | global $wp_current_db_version; |
| … |
… |
function upgrade_400() {
|
| 1329 | 1334 | } |
| 1330 | 1335 | |
| 1331 | 1336 | /** |
| 1332 | | * Execute network level changes |
| | 1337 | * Execute network level changes. |
| 1333 | 1338 | * |
| 1334 | 1339 | * @since 3.0.0 |
| 1335 | 1340 | */ |
| … |
… |
function upgrade_network() {
|
| 1431 | 1436 | // General |
| 1432 | 1437 | |
| 1433 | 1438 | /** |
| 1434 | | * {@internal Missing Short Description}} |
| | 1439 | * Create a table in the database if it doesn't already exist. |
| 1435 | 1440 | * |
| 1436 | | * {@internal Missing Long Description}} |
| | 1441 | * This method checks for an existing database and creates a new one if it's not |
| | 1442 | * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses |
| | 1443 | * to query all tables first and then run the SQL statement creating the table. |
| 1437 | 1444 | * |
| 1438 | 1445 | * @since 1.0.0 |
| 1439 | 1446 | * |
| … |
… |
function maybe_create_table($table_name, $create_ddl) {
|
| 1461 | 1468 | } |
| 1462 | 1469 | |
| 1463 | 1470 | /** |
| 1464 | | * {@internal Missing Short Description}} |
| 1465 | | * |
| 1466 | | * {@internal Missing Long Description}} |
| | 1471 | * Drop a specified index from a table. |
| 1467 | 1472 | * |
| 1468 | 1473 | * @since 1.0.1 |
| 1469 | 1474 | * |
| … |
… |
function drop_index($table, $index) {
|
| 1484 | 1489 | } |
| 1485 | 1490 | |
| 1486 | 1491 | /** |
| 1487 | | * {@internal Missing Short Description}} |
| 1488 | | * |
| 1489 | | * {@internal Missing Long Description}} |
| | 1492 | * Add an index to a specified table. |
| 1490 | 1493 | * |
| 1491 | 1494 | * @since 1.0.1 |
| 1492 | 1495 | * |
| … |
… |
function add_clean_index($table, $index) {
|
| 1502 | 1505 | } |
| 1503 | 1506 | |
| 1504 | 1507 | /** |
| 1505 | | ** maybe_add_column() |
| 1506 | | ** Add column to db table if it doesn't exist. |
| 1507 | | ** Returns: true if already exists or on successful completion |
| 1508 | | ** false on error |
| | 1508 | * Add column to a database table if it doesn't already exist. |
| | 1509 | * |
| | 1510 | * @since 1.3.0 |
| | 1511 | * |
| | 1512 | * @param string $table_name The table name to modify. |
| | 1513 | * @param string $column_name The column name to add to the table. |
| | 1514 | * @param string $create_ddl The SQL statement used to add the column. |
| | 1515 | * @return True if already exists or on successful completion, false on error. |
| 1509 | 1516 | */ |
| 1510 | 1517 | function maybe_add_column($table_name, $column_name, $create_ddl) { |
| 1511 | 1518 | global $wpdb; |
| … |
… |
function get_alloptions_110() {
|
| 1548 | 1555 | } |
| 1549 | 1556 | |
| 1550 | 1557 | /** |
| 1551 | | * Version of get_option that is private to install/upgrade. |
| | 1558 | * Version of {@link get_option} that is private to install/upgrade. |
| 1552 | 1559 | * |
| 1553 | 1560 | * @since 1.5.1 |
| 1554 | 1561 | * @access private |
| … |
… |
function __get_option($setting) {
|
| 1577 | 1584 | } |
| 1578 | 1585 | |
| 1579 | 1586 | /** |
| 1580 | | * {@internal Missing Short Description}} |
| 1581 | | * |
| 1582 | | * {@internal Missing Long Description}} |
| | 1587 | * Filter for content to remove unnecessary slashes. |
| 1583 | 1588 | * |
| 1584 | 1589 | * @since 1.5.0 |
| 1585 | 1590 | * |
| 1586 | | * @param string $content |
| 1587 | | * @return string |
| | 1591 | * @param string $content The content to modify. |
| | 1592 | * @return string The de-slashed content. |
| 1588 | 1593 | */ |
| 1589 | 1594 | function deslash($content) { |
| 1590 | 1595 | // Note: \\\ inside a regex denotes a single backslash. |
| … |
… |
function deslash($content) {
|
| 1608 | 1613 | } |
| 1609 | 1614 | |
| 1610 | 1615 | /** |
| 1611 | | * {@internal Missing Short Description}} |
| | 1616 | * Modify the database based on specified SQL statements. |
| 1612 | 1617 | * |
| 1613 | | * {@internal Missing Long Description}} |
| | 1618 | * Useful for creating new tables, and updating existing tables to a new structure. |
| 1614 | 1619 | * |
| 1615 | 1620 | * @since 1.5.0 |
| 1616 | 1621 | * |
| 1617 | | * @param string $queries |
| 1618 | | * @param bool $execute |
| 1619 | | * @return array |
| | 1622 | * @param string|array $queries The query to run. Can be multiple queries in an array, |
| | 1623 | * or a string of queries separated by semicolons. |
| | 1624 | * @param bool $execute Whether or not to execute the query right away. |
| | 1625 | * @return array Strings containing the results of the various update queries. |
| 1620 | 1626 | */ |
| 1621 | 1627 | function dbDelta( $queries = '', $execute = true ) { |
| 1622 | 1628 | global $wpdb; |
| … |
… |
function dbDelta( $queries = '', $execute = true ) {
|
| 1859 | 1865 | } |
| 1860 | 1866 | |
| 1861 | 1867 | /** |
| 1862 | | * {@internal Missing Short Description}} |
| | 1868 | * Update the database tables to a new schema. |
| 1863 | 1869 | * |
| 1864 | | * {@internal Missing Long Description}} |
| | 1870 | * By default, updates all the tables to use the latest defined schema, but can also |
| | 1871 | * be used to update a specific set of tables in {@see wp_get_db_schema()}. |
| 1865 | 1872 | * |
| 1866 | 1873 | * @since 1.5.0 |
| | 1874 | * @uses dbDelta |
| | 1875 | * |
| | 1876 | * @param string $tables Optional. Which set of tables to update. Default is 'all'. |
| 1867 | 1877 | */ |
| 1868 | 1878 | function make_db_current( $tables = 'all' ) { |
| 1869 | 1879 | $alterations = dbDelta( $tables ); |
| … |
… |
function make_db_current( $tables = 'all' ) {
|
| 1873 | 1883 | } |
| 1874 | 1884 | |
| 1875 | 1885 | /** |
| 1876 | | * {@internal Missing Short Description}} |
| | 1886 | * Update the database tables to a new schema, but without displaying results. |
| 1877 | 1887 | * |
| 1878 | | * {@internal Missing Long Description}} |
| | 1888 | * By default, updates all the tables to use the latest defined schema, but can also |
| | 1889 | * be used to update a specific set of tables in {@see wp_get_db_schema()}. |
| 1879 | 1890 | * |
| 1880 | 1891 | * @since 1.5.0 |
| | 1892 | * @see make_db_current() |
| | 1893 | * |
| | 1894 | * @param string $tables Optional. Which set of tables to update. Default is 'all'. |
| 1881 | 1895 | */ |
| 1882 | 1896 | function make_db_current_silent( $tables = 'all' ) { |
| 1883 | 1897 | dbDelta( $tables ); |
| 1884 | 1898 | } |
| 1885 | 1899 | |
| 1886 | 1900 | /** |
| 1887 | | * {@internal Missing Short Description}} |
| | 1901 | * Create a site theme from an existing theme. |
| 1888 | 1902 | * |
| 1889 | 1903 | * {@internal Missing Long Description}} |
| 1890 | 1904 | * |
| 1891 | 1905 | * @since 1.5.0 |
| 1892 | 1906 | * |
| 1893 | | * @param string $theme_name |
| 1894 | | * @param string $template |
| | 1907 | * @param string $theme_name The name of the theme. |
| | 1908 | * @param string $template The directory name of the theme. |
| 1895 | 1909 | * @return bool |
| 1896 | 1910 | */ |
| 1897 | 1911 | function make_site_theme_from_oldschool($theme_name, $template) { |
| … |
… |
function make_site_theme_from_oldschool($theme_name, $template) {
|
| 1967 | 1981 | } |
| 1968 | 1982 | |
| 1969 | 1983 | /** |
| 1970 | | * {@internal Missing Short Description}} |
| | 1984 | * Create a site theme from the default theme. |
| 1971 | 1985 | * |
| 1972 | 1986 | * {@internal Missing Long Description}} |
| 1973 | 1987 | * |
| 1974 | 1988 | * @since 1.5.0 |
| 1975 | 1989 | * |
| 1976 | | * @param string $theme_name |
| 1977 | | * @param string $template |
| | 1990 | * @param string $theme_name The name of the theme. |
| | 1991 | * @param string $template The directory name of the theme. |
| 1978 | 1992 | * @return null|false |
| 1979 | 1993 | */ |
| 1980 | 1994 | function make_site_theme_from_default($theme_name, $template) { |
| … |
… |
function make_site_theme_from_default($theme_name, $template) {
|
| 2031 | 2045 | @closedir($images_dir); |
| 2032 | 2046 | } |
| 2033 | 2047 | |
| 2034 | | // Create a site theme from the default theme. |
| 2035 | 2048 | /** |
| 2036 | | * {@internal Missing Short Description}} |
| | 2049 | * Create a site theme. |
| 2037 | 2050 | * |
| 2038 | 2051 | * {@internal Missing Long Description}} |
| 2039 | 2052 | * |
| … |
… |
function translate_level_to_role($level) {
|
| 2112 | 2125 | } |
| 2113 | 2126 | |
| 2114 | 2127 | /** |
| 2115 | | * {@internal Missing Short Description}} |
| 2116 | | * |
| 2117 | | * {@internal Missing Long Description}} |
| | 2128 | * Check the version of the installed MySQL binary. |
| 2118 | 2129 | * |
| 2119 | 2130 | * @since 2.1.0 |
| 2120 | 2131 | */ |
| … |
… |
function maybe_disable_automattic_widgets() {
|
| 2143 | 2154 | } |
| 2144 | 2155 | |
| 2145 | 2156 | /** |
| 2146 | | * Disables the Link Manager on upgrade, if at the time of upgrade, no links exist in the DB. |
| | 2157 | * Disables the Link Manager on upgrade if, at the time of upgrade, no links exist in the DB. |
| 2147 | 2158 | * |
| 2148 | 2159 | * @since 3.5.0 |
| 2149 | 2160 | */ |