Make WordPress Core

Changeset 47786


Ignore:
Timestamp:
05/12/2020 06:38:02 PM (7 years ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/upgrade.php

    r47785 r47786  
    21852185        delete_expired_transients( true );
    21862186
    2187         // 2.8
     2187        // 2.8.0
    21882188        if ( $wp_current_db_version < 11549 ) {
    21892189                $wpmu_sitewide_plugins   = get_site_option( 'wpmu_sitewide_plugins' );
    … …  
    22162216        }
    22172217
    2218         // 3.0
     2218        // 3.0.0
    22192219        if ( $wp_current_db_version < 13576 ) {
    22202220                update_site_option( 'global_terms_enabled', '1' );
    22212221        }
    22222222
    2223         // 3.3
     2223        // 3.3.0
    22242224        if ( $wp_current_db_version < 19390 ) {
    22252225                update_site_option( 'initial_db_version', $wp_current_db_version );
    … …  
    22322232        }
    22332233
    2234         // 3.4
     2234        // 3.4.0
    22352235        if ( $wp_current_db_version < 20148 ) {
    22362236                // 'allowedthemes' keys things by stylesheet. 'allowed_themes' keyed things by name.
    … …  
    22502250        }
    22512251
    2252         // 3.5
     2252        // 3.5.0
    22532253        if ( $wp_current_db_version < 21823 ) {
    22542254                update_site_option( 'ms_files_rewriting', '1' );
    … …  
    22652265        }
    22662266
    2267         // 4.2
     2267        // 4.2.0
    22682268        if ( $wp_current_db_version < 31351 && 'utf8mb4' === $wpdb->charset ) {
    22692269                if ( wp_should_upgrade_global_tables() ) {
    … …  
    22862286        }
    22872287
    2288         // 4.3
     2288        // 4.3.0
    22892289        if ( $wp_current_db_version < 33055 && 'utf8mb4' === $wpdb->charset ) {
    22902290                if ( wp_should_upgrade_global_tables() ) {
    … …  
    23152315        }
    23162316
    2317         // 5.1
     2317        // 5.1.0
    23182318        if ( $wp_current_db_version < 44467 ) {
    23192319                $network_id = get_main_network_id();
    … …  
    23282328
    23292329/**
    2330  * Creates a table in the database if it doesn't already exist.
     2330 * Creates a table in the database, if it doesn't already exist.
    23312331 *
    23322332 * This method checks for an existing database and creates a new one if it's not
    … …  
    23382338 * @global wpdb $wpdb WordPress database abstraction object.
    23392339 *
    2340  * @param string $table_name Database table name to create.
     2340 * @param string $table_name Database table name.
    23412341 * @param string $create_ddl SQL statement to create table.
    2342  * @return bool If table already exists or was created by function.
     2342 * @return bool True on success or if the table already exists. False on failure.
    23432343 */
    23442344function maybe_create_table( $table_name, $create_ddl ) {
    … …  
    24112411
    24122412/**
    2413  * Adds column to a database table if it doesn't already exist.
     2413 * Adds column to a database table, if it doesn't already exist.
    24142414 *
    24152415 * @since 1.3.0
    … …  
    24172417 * @global wpdb $wpdb WordPress database abstraction object.
    24182418 *
    2419  * @param string $table_name  The table name to modify.
    2420  * @param string $column_name The column name to add to the table.
    2421  * @param string $create_ddl  The SQL statement used to add the column.
    2422  * @return bool True if already exists or on successful completion, false on error.
     2419 * @param string $table_name  Database table name.
     2420 * @param string $column_name Table column name.
     2421 * @param string $create_ddl  SQL statement to add column.
     2422 * @return bool True on success or if the column already exists. False on failure.
    24232423 */
    24242424function maybe_add_column( $table_name, $column_name, $create_ddl ) {
    … …  
    24522452 *
    24532453 * @param string $table The table to convert.
    2454  * @return bool true if the table was converted, false if it wasn't.
     2454 * @return bool True if the table was converted, false if it wasn't.
    24552455 */
    24562456function maybe_convert_table_to_utf8mb4( $table ) {
  • trunk/src/wp-admin/install-helper.php

    r47785 r47786  
    4040if ( ! function_exists( 'maybe_create_table' ) ) :
    4141        /**
    42          * Create database table, if it doesn't already exist.
     42         * Creates a table in the database if it doesn't already exist.
    4343         *
    4444         * @since 1.0.0
    … …  
    4747         *
    4848         * @param string $table_name Database table name.
    49          * @param string $create_ddl Create database table SQL.
    50          * @return bool False on error, true if already exists or success.
     49         * @param string $create_ddl SQL statement to create table.
     50         * @return bool True on success or if the table already exists. False on failure.
    5151         */
    5252        function maybe_create_table( $table_name, $create_ddl ) {
    … …  
    7575if ( ! function_exists( 'maybe_add_column' ) ) :
    7676        /**
    77          * Add column to database table, if column doesn't already exist in table.
     77         * Adds column to database table, if it doesn't already exist.
    7878         *
    7979         * @since 1.0.0
    … …  
    8181         * @global wpdb $wpdb WordPress database abstraction object.
    8282         *
    83          * @param string $table_name Database table name
    84          * @param string $column_name Table column name
    85          * @param string $create_ddl SQL to add column to table.
    86          * @return bool False on failure. True, if already exists or was successful.
     83         * @param string $table_name  Database table name.
     84         * @param string $column_name Table column name.
     85         * @param string $create_ddl  SQL statement to add column.
     86         * @return bool True on success or if the column already exists. False on failure.
    8787         */
    8888        function maybe_add_column( $table_name, $column_name, $create_ddl ) {
    … …  
    110110
    111111/**
    112  * Drop column from database table, if it exists.
     112 * Drops column from database table, if it exists.
    113113 *
    114114 * @since 1.0.0
    … …  
    116116 * @global wpdb $wpdb WordPress database abstraction object.
    117117 *
    118  * @param string $table_name Table name
    119  * @param string $column_name Column name
    120  * @param string $drop_ddl SQL statement to drop column.
    121  * @return bool True on success or if the column doesn't exist, false on failure.
     118 * @param string $table_name  Database table name.
     119 * @param string $column_name Table column name.
     120 * @param string $drop_ddl    SQL statement to drop column.
     121 * @return bool True on success or if the column doesn't exist. False on failure.
    122122 */
    123123function maybe_drop_column( $table_name, $column_name, $drop_ddl ) {
    … …  
    144144
    145145/**
    146  * Check column matches criteria.
     146 * Checks that database table column matches the criteria.
    147147 *
    148148 * Uses the SQL DESC for retrieving the table info for the column. It will help
    … …  
    163163 * @global wpdb $wpdb WordPress database abstraction object.
    164164 *
    165  * @param string $table_name Table name
    166  * @param string $col_name   Column name
    167  * @param string $col_type   Column type
     165 * @param string $table_name Database table name.
     166 * @param string $col_name   Table column name.
     167 * @param string $col_type   Table column type.
    168168 * @param bool   $is_null    Optional. Check is null.
    169169 * @param mixed  $key        Optional. Key info.
Note: See TracChangeset for help on using the changeset viewer.