[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-admin/includes/ -> upgrade.php (summary)

WordPress Upgrade API Most of the functions are pluggable and can be overwritten.

File Size: 3386 lines (105 kb)
Included or required: 9 times
Referenced: 1 time
Includes or requires: 3 files
 wp-admin/includes/class-wp-privacy-policy-content.php
 wp-admin/includes/schema.php
 wp-admin/includes/admin.php

Defines 62 functions

  wp_install()
  wp_install_defaults()
  wp_install_maybe_enable_pretty_permalinks()
  wp_new_blog_notification()
  wp_upgrade()
  upgrade_all()
  upgrade_100()
  upgrade_101()
  upgrade_110()
  upgrade_130()
  upgrade_160()
  upgrade_210()
  upgrade_230()
  upgrade_230_options_table()
  upgrade_230_old_tables()
  upgrade_old_slugs()
  upgrade_250()
  upgrade_252()
  upgrade_260()
  upgrade_270()
  upgrade_280()
  upgrade_290()
  upgrade_300()
  upgrade_330()
  upgrade_340()
  upgrade_350()
  upgrade_370()
  upgrade_372()
  upgrade_380()
  upgrade_400()
  upgrade_420()
  upgrade_430()
  upgrade_430_fix_comments()
  upgrade_431()
  upgrade_440()
  upgrade_450()
  upgrade_460()
  upgrade_500()
  upgrade_510()
  upgrade_530()
  upgrade_network()
  maybe_create_table()
  drop_index()
  add_clean_index()
  maybe_add_column()
  maybe_convert_table_to_utf8mb4()
  get_alloptions_110()
  __get_option()
  deslash()
  dbDelta()
  make_db_current()
  make_db_current_silent()
  make_site_theme_from_oldschool()
  make_site_theme_from_default()
  make_site_theme()
  translate_level_to_role()
  wp_check_mysql_version()
  maybe_disable_automattic_widgets()
  maybe_disable_link_manager()
  pre_schema_upgrade()
  install_global_terms()
  wp_should_upgrade_global_tables()

Functions
Functions that are not part of a class:

wp_install( $blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '', $language = '' )   X-Ref
Installs the site.

Runs the required functions to set up and populate the database,
including primary admin user and initial options.

param: string $blog_title    Site title.
param: string $user_name     User's username.
param: string $user_email    User's email.
param: bool   $public        Whether site is public.
param: string $deprecated    Optional. Not used.
param: string $user_password Optional. User's chosen password. Default empty (random password).
param: string $language      Optional. Language chosen. Default empty.
return: array {

wp_install_defaults( $user_id )   X-Ref
Creates the initial content for a newly-installed site.

Adds the default "Uncategorized" category, the first post (with comment),
first page, and default widgets for default theme for the current version.

param: int $user_id User ID.

wp_install_maybe_enable_pretty_permalinks()   X-Ref
Maybe enable pretty permalinks on installation.

If after enabling pretty permalinks don't work, fallback to query-string permalinks.

return: bool Whether pretty permalinks are enabled. False otherwise.

wp_new_blog_notification( $blog_title, $blog_url, $user_id, $password )   X-Ref
Notifies the site admin that the setup is complete.

Sends an email with wp_mail to the new administrator that the site setup is complete,
and provides them with a record of their login credentials.

param: string $blog_title Site title.
param: string $blog_url   Site url.
param: int    $user_id    User ID.
param: string $password   User's Password.

wp_upgrade()   X-Ref
Runs WordPress Upgrade functions.

Upgrades the database if needed during a site update.


upgrade_all()   X-Ref
Functions to be called in installation and upgrade scripts.

Contains conditional checks to determine which upgrade scripts to run,
based on database version and WP version being updated-to.


upgrade_100()   X-Ref
Execute changes made in WordPress 1.0.


upgrade_101()   X-Ref
Execute changes made in WordPress 1.0.1.


upgrade_110()   X-Ref
Execute changes made in WordPress 1.2.


upgrade_130()   X-Ref
Execute changes made in WordPress 1.5.


upgrade_160()   X-Ref
Execute changes made in WordPress 2.0.


upgrade_210()   X-Ref
Execute changes made in WordPress 2.1.


upgrade_230()   X-Ref
Execute changes made in WordPress 2.3.


upgrade_230_options_table()   X-Ref
Remove old options from the database.


upgrade_230_old_tables()   X-Ref
Remove old categories, link2cat, and post2cat database tables.


upgrade_old_slugs()   X-Ref
Upgrade old slugs made in version 2.2.


upgrade_250()   X-Ref
Execute changes made in WordPress 2.5.0.


upgrade_252()   X-Ref
Execute changes made in WordPress 2.5.2.


upgrade_260()   X-Ref
Execute changes made in WordPress 2.6.


upgrade_270()   X-Ref
Execute changes made in WordPress 2.7.


upgrade_280()   X-Ref
Execute changes made in WordPress 2.8.


upgrade_290()   X-Ref
Execute changes made in WordPress 2.9.


upgrade_300()   X-Ref
Execute changes made in WordPress 3.0.


upgrade_330()   X-Ref
Execute changes made in WordPress 3.3.


upgrade_340()   X-Ref
Execute changes made in WordPress 3.4.


upgrade_350()   X-Ref
Execute changes made in WordPress 3.5.


upgrade_370()   X-Ref
Execute changes made in WordPress 3.7.


upgrade_372()   X-Ref
Execute changes made in WordPress 3.7.2.


upgrade_380()   X-Ref
Execute changes made in WordPress 3.8.0.


upgrade_400()   X-Ref
Execute changes made in WordPress 4.0.0.


upgrade_420()   X-Ref
Execute changes made in WordPress 4.2.0.


upgrade_430()   X-Ref
Executes changes made in WordPress 4.3.0.


upgrade_430_fix_comments()   X-Ref
Executes comments changes made in WordPress 4.3.0.


upgrade_431()   X-Ref
Executes changes made in WordPress 4.3.1.


upgrade_440()   X-Ref
Executes changes made in WordPress 4.4.0.


upgrade_450()   X-Ref
Executes changes made in WordPress 4.5.0.


upgrade_460()   X-Ref
Executes changes made in WordPress 4.6.0.


upgrade_500()   X-Ref
Executes changes made in WordPress 5.0.0.


upgrade_510()   X-Ref
Executes changes made in WordPress 5.1.0.


upgrade_530()   X-Ref
Executes changes made in WordPress 5.3.0.


upgrade_network()   X-Ref
Executes network-level upgrade routines.


maybe_create_table( $table_name, $create_ddl )   X-Ref
Creates a table in the database if it doesn't already exist.

This method checks for an existing database and creates a new one if it's not
already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
to query all tables first and then run the SQL statement creating the table.

param: string $table_name Database table name to create.
param: string $create_ddl SQL statement to create table.
return: bool If table already exists or was created by function.

drop_index( $table, $index )   X-Ref
Drops a specified index from a table.

param: string $table Database table name.
param: string $index Index name to drop.
return: true True, when finished.

add_clean_index( $table, $index )   X-Ref
Adds an index to a specified table.

param: string $table Database table name.
param: string $index Database table index column.
return: true True, when done with execution.

maybe_add_column( $table_name, $column_name, $create_ddl )   X-Ref
Adds column to a database table if it doesn't already exist.

param: string $table_name  The table name to modify.
param: string $column_name The column name to add to the table.
param: string $create_ddl  The SQL statement used to add the column.
return: bool True if already exists or on successful completion, false on error.

maybe_convert_table_to_utf8mb4( $table )   X-Ref
If a table only contains utf8 or utf8mb4 columns, convert it to utf8mb4.

param: string $table The table to convert.
return: bool true if the table was converted, false if it wasn't.

get_alloptions_110()   X-Ref
Retrieve all options as it was for 1.2.

return: stdClass List of options.

__get_option( $setting )   X-Ref
Utility version of get_option that is private to installation/upgrade.

param: string $setting Option name.
return: mixed

deslash( $content )   X-Ref
Filters for content to remove unnecessary slashes.

param: string $content The content to modify.
return: string The de-slashed content.

dbDelta( $queries = '', $execute = true )   X-Ref
Modifies the database based on specified SQL statements.

Useful for creating new tables and updating existing tables to a new structure.

param: string[]|string $queries Optional. The query to run. Can be multiple queries
param: bool            $execute Optional. Whether or not to execute the query right away.
return: array Strings containing the results of the various update queries.

make_db_current( $tables = 'all' )   X-Ref
Updates the database tables to a new schema.

By default, updates all the tables to use the latest defined schema, but can also
be used to update a specific set of tables in wp_get_db_schema().

param: string $tables Optional. Which set of tables to update. Default is 'all'.

make_db_current_silent( $tables = 'all' )   X-Ref
Updates the database tables to a new schema, but without displaying results.

By default, updates all the tables to use the latest defined schema, but can
also be used to update a specific set of tables in wp_get_db_schema().

param: string $tables Optional. Which set of tables to update. Default is 'all'.

make_site_theme_from_oldschool( $theme_name, $template )   X-Ref
Creates a site theme from an existing theme.

{@internal Missing Long Description}}

param: string $theme_name The name of the theme.
param: string $template   The directory name of the theme.
return: bool

make_site_theme_from_default( $theme_name, $template )   X-Ref
Creates a site theme from the default theme.

{@internal Missing Long Description}}

param: string $theme_name The name of the theme.
param: string $template   The directory name of the theme.
return: false|void

make_site_theme()   X-Ref
Creates a site theme.

{@internal Missing Long Description}}

return: false|string

translate_level_to_role( $level )   X-Ref
Translate user level to user role name.

param: int $level User level.
return: string User role name.

wp_check_mysql_version()   X-Ref
Checks the version of the installed MySQL binary.


maybe_disable_automattic_widgets()   X-Ref
Disables the Automattic widgets plugin, which was merged into core.


maybe_disable_link_manager()   X-Ref
Disables the Link Manager on upgrade if, at the time of upgrade, no links exist in the DB.


pre_schema_upgrade()   X-Ref
Runs before the schema is upgraded.


install_global_terms()   X-Ref
Install global terms.


wp_should_upgrade_global_tables()   X-Ref
Determine if global tables should be upgraded.

This function performs a series of checks to ensure the environment allows
for the safe upgrading of global WordPress database tables. It is necessary
because global tables will commonly grow to millions of rows on large
installations, and the ability to control their upgrade routines can be
critical to the operation of large networks.

In a future iteration, this function may use `wp_is_large_network()` to more-
intelligently prevent global table upgrades. Until then, we make sure
WordPress is on the main site of the main network, to avoid running queries
more than once in multi-site or multi-network environments.

return: bool Whether to run the upgrade routines on global tables.



Generated: Sat Nov 23 20:47:33 2019 Cross-referenced by PHPXref 0.7