Docs: Improve documentation for functions in wp-admin/install-helper.php per the documentation standards.

Synchronize descriptions with the functions' counterparts from `wp-admin/includes/upgrade.php`.

See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@47786 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-05-12 18:38:02 +00:00
parent 94d96bde71
commit b42fe1e654
2 changed files with 34 additions and 34 deletions

View File

@ -2184,7 +2184,7 @@ function upgrade_network() {
// Always clear expired transients. // Always clear expired transients.
delete_expired_transients( true ); delete_expired_transients( true );
// 2.8 // 2.8.0
if ( $wp_current_db_version < 11549 ) { if ( $wp_current_db_version < 11549 ) {
$wpmu_sitewide_plugins = get_site_option( 'wpmu_sitewide_plugins' ); $wpmu_sitewide_plugins = get_site_option( 'wpmu_sitewide_plugins' );
$active_sitewide_plugins = get_site_option( 'active_sitewide_plugins' ); $active_sitewide_plugins = get_site_option( 'active_sitewide_plugins' );
@ -2215,12 +2215,12 @@ function upgrade_network() {
} }
} }
// 3.0 // 3.0.0
if ( $wp_current_db_version < 13576 ) { if ( $wp_current_db_version < 13576 ) {
update_site_option( 'global_terms_enabled', '1' ); update_site_option( 'global_terms_enabled', '1' );
} }
// 3.3 // 3.3.0
if ( $wp_current_db_version < 19390 ) { if ( $wp_current_db_version < 19390 ) {
update_site_option( 'initial_db_version', $wp_current_db_version ); update_site_option( 'initial_db_version', $wp_current_db_version );
} }
@ -2231,7 +2231,7 @@ function upgrade_network() {
} }
} }
// 3.4 // 3.4.0
if ( $wp_current_db_version < 20148 ) { if ( $wp_current_db_version < 20148 ) {
// 'allowedthemes' keys things by stylesheet. 'allowed_themes' keyed things by name. // 'allowedthemes' keys things by stylesheet. 'allowed_themes' keyed things by name.
$allowedthemes = get_site_option( 'allowedthemes' ); $allowedthemes = get_site_option( 'allowedthemes' );
@ -2249,7 +2249,7 @@ function upgrade_network() {
} }
} }
// 3.5 // 3.5.0
if ( $wp_current_db_version < 21823 ) { if ( $wp_current_db_version < 21823 ) {
update_site_option( 'ms_files_rewriting', '1' ); update_site_option( 'ms_files_rewriting', '1' );
} }
@ -2264,7 +2264,7 @@ function upgrade_network() {
} }
} }
// 4.2 // 4.2.0
if ( $wp_current_db_version < 31351 && 'utf8mb4' === $wpdb->charset ) { if ( $wp_current_db_version < 31351 && 'utf8mb4' === $wpdb->charset ) {
if ( wp_should_upgrade_global_tables() ) { if ( wp_should_upgrade_global_tables() ) {
$wpdb->query( "ALTER TABLE $wpdb->usermeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" ); $wpdb->query( "ALTER TABLE $wpdb->usermeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
@ -2285,7 +2285,7 @@ function upgrade_network() {
} }
} }
// 4.3 // 4.3.0
if ( $wp_current_db_version < 33055 && 'utf8mb4' === $wpdb->charset ) { if ( $wp_current_db_version < 33055 && 'utf8mb4' === $wpdb->charset ) {
if ( wp_should_upgrade_global_tables() ) { if ( wp_should_upgrade_global_tables() ) {
$upgrade = false; $upgrade = false;
@ -2314,7 +2314,7 @@ function upgrade_network() {
} }
} }
// 5.1 // 5.1.0
if ( $wp_current_db_version < 44467 ) { if ( $wp_current_db_version < 44467 ) {
$network_id = get_main_network_id(); $network_id = get_main_network_id();
delete_network_option( $network_id, 'site_meta_supported' ); delete_network_option( $network_id, 'site_meta_supported' );
@ -2327,7 +2327,7 @@ function upgrade_network() {
// //
/** /**
* Creates a table in the database if it doesn't already exist. * 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 * 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 * already present. It doesn't rely on MySQL's "IF NOT EXISTS" statement, but chooses
@ -2337,9 +2337,9 @@ function upgrade_network() {
* *
* @global wpdb $wpdb WordPress database abstraction object. * @global wpdb $wpdb WordPress database abstraction object.
* *
* @param string $table_name Database table name to create. * @param string $table_name Database table name.
* @param string $create_ddl SQL statement to create table. * @param string $create_ddl SQL statement to create table.
* @return bool If table already exists or was created by function. * @return bool True on success or if the table already exists. False on failure.
*/ */
function maybe_create_table( $table_name, $create_ddl ) { function maybe_create_table( $table_name, $create_ddl ) {
global $wpdb; global $wpdb;
@ -2410,16 +2410,16 @@ function add_clean_index( $table, $index ) {
} }
/** /**
* Adds column to a database table if it doesn't already exist. * Adds column to a database table, if it doesn't already exist.
* *
* @since 1.3.0 * @since 1.3.0
* *
* @global wpdb $wpdb WordPress database abstraction object. * @global wpdb $wpdb WordPress database abstraction object.
* *
* @param string $table_name The table name to modify. * @param string $table_name Database table name.
* @param string $column_name The column name to add to the table. * @param string $column_name Table column name.
* @param string $create_ddl The SQL statement used to add the column. * @param string $create_ddl SQL statement to add column.
* @return bool True if already exists or on successful completion, false on error. * @return bool True on success or if the column already exists. False on failure.
*/ */
function maybe_add_column( $table_name, $column_name, $create_ddl ) { function maybe_add_column( $table_name, $column_name, $create_ddl ) {
global $wpdb; global $wpdb;
@ -2451,7 +2451,7 @@ function maybe_add_column( $table_name, $column_name, $create_ddl ) {
* @global wpdb $wpdb WordPress database abstraction object. * @global wpdb $wpdb WordPress database abstraction object.
* *
* @param string $table The table to convert. * @param string $table The table to convert.
* @return bool true if the table was converted, false if it wasn't. * @return bool True if the table was converted, false if it wasn't.
*/ */
function maybe_convert_table_to_utf8mb4( $table ) { function maybe_convert_table_to_utf8mb4( $table ) {
global $wpdb; global $wpdb;

View File

@ -39,15 +39,15 @@ require_once dirname( __DIR__ ) . '/wp-load.php';
if ( ! function_exists( 'maybe_create_table' ) ) : if ( ! function_exists( 'maybe_create_table' ) ) :
/** /**
* Create database table, if it doesn't already exist. * Creates a table in the database if it doesn't already exist.
* *
* @since 1.0.0 * @since 1.0.0
* *
* @global wpdb $wpdb WordPress database abstraction object. * @global wpdb $wpdb WordPress database abstraction object.
* *
* @param string $table_name Database table name. * @param string $table_name Database table name.
* @param string $create_ddl Create database table SQL. * @param string $create_ddl SQL statement to create table.
* @return bool False on error, true if already exists or success. * @return bool True on success or if the table already exists. False on failure.
*/ */
function maybe_create_table( $table_name, $create_ddl ) { function maybe_create_table( $table_name, $create_ddl ) {
global $wpdb; global $wpdb;
@ -74,16 +74,16 @@ endif;
if ( ! function_exists( 'maybe_add_column' ) ) : if ( ! function_exists( 'maybe_add_column' ) ) :
/** /**
* Add column to database table, if column doesn't already exist in table. * Adds column to database table, if it doesn't already exist.
* *
* @since 1.0.0 * @since 1.0.0
* *
* @global wpdb $wpdb WordPress database abstraction object. * @global wpdb $wpdb WordPress database abstraction object.
* *
* @param string $table_name Database table name * @param string $table_name Database table name.
* @param string $column_name Table column name * @param string $column_name Table column name.
* @param string $create_ddl SQL to add column to table. * @param string $create_ddl SQL statement to add column.
* @return bool False on failure. True, if already exists or was successful. * @return bool True on success or if the column already exists. False on failure.
*/ */
function maybe_add_column( $table_name, $column_name, $create_ddl ) { function maybe_add_column( $table_name, $column_name, $create_ddl ) {
global $wpdb; global $wpdb;
@ -109,16 +109,16 @@ if ( ! function_exists( 'maybe_add_column' ) ) :
endif; endif;
/** /**
* Drop column from database table, if it exists. * Drops column from database table, if it exists.
* *
* @since 1.0.0 * @since 1.0.0
* *
* @global wpdb $wpdb WordPress database abstraction object. * @global wpdb $wpdb WordPress database abstraction object.
* *
* @param string $table_name Table name * @param string $table_name Database table name.
* @param string $column_name Column name * @param string $column_name Table column name.
* @param string $drop_ddl SQL statement to drop column. * @param string $drop_ddl SQL statement to drop column.
* @return bool True on success or if the column doesn't exist, false on failure. * @return bool True on success or if the column doesn't exist. False on failure.
*/ */
function maybe_drop_column( $table_name, $column_name, $drop_ddl ) { function maybe_drop_column( $table_name, $column_name, $drop_ddl ) {
global $wpdb; global $wpdb;
@ -143,7 +143,7 @@ function maybe_drop_column( $table_name, $column_name, $drop_ddl ) {
} }
/** /**
* Check column matches criteria. * Checks that database table column matches the criteria.
* *
* Uses the SQL DESC for retrieving the table info for the column. It will help * Uses the SQL DESC for retrieving the table info for the column. It will help
* understand the parameters, if you do more research on what column information * understand the parameters, if you do more research on what column information
@ -162,9 +162,9 @@ function maybe_drop_column( $table_name, $column_name, $drop_ddl ) {
* *
* @global wpdb $wpdb WordPress database abstraction object. * @global wpdb $wpdb WordPress database abstraction object.
* *
* @param string $table_name Table name * @param string $table_name Database table name.
* @param string $col_name Column name * @param string $col_name Table column name.
* @param string $col_type Column type * @param string $col_type Table column type.
* @param bool $is_null Optional. Check is null. * @param bool $is_null Optional. Check is null.
* @param mixed $key Optional. Key info. * @param mixed $key Optional. Key info.
* @param mixed $default Optional. Default value. * @param mixed $default Optional. Default value.