Make WordPress Core


Ignore:
Timestamp:
11/20/2022 02:08:38 PM (16 months ago)
Author:
SergeyBiryukov
Message:

Docs: Fix typo and improve DocBlock formatting in wp-admin/install-helper.php.

Follow-up to [236], [265], [8645], [30542].

See #56792.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/install-helper.php

    r54858 r54859  
    11<?php
    22/**
    3  * Plugins may load this file to gain access to special helper functions for
    4  * plugin installation. This file is not included by WordPress and it is
     3 * Plugins may load this file to gain access to special helper functions
     4 * for plugin installation. This file is not included by WordPress and it is
    55 * recommended, to prevent fatal errors, that this file is included using
    66 * require_once.
     
    88 * These functions are not optimized for speed, but they should only be used
    99 * once in a while, so speed shouldn't be a concern. If it is and you are
    10  * needing to use these functions a lot, you might experience time outs. If you
    11  * do, then it is advised to just write the SQL code yourself.
     10 * needing to use these functions a lot, you might experience timeouts.
     11 * If you do, then it is advised to just write the SQL code yourself.
    1212 *
    1313 *     check_column( 'wp_links', 'link_description', 'mediumtext' );
     14 *
    1415 *     if ( check_column( $wpdb->comments, 'comment_author', 'tinytext' ) ) {
    1516 *         echo "ok\n";
    1617 *     }
    1718 *
    18  *     $error_count = 0;
    19  *     $tablename = $wpdb->links;
    2019 *     // Check the column.
    2120 *     if ( ! check_column( $wpdb->links, 'link_description', 'varchar( 255 )' ) ) {
     
    2322 *         $q = $wpdb->query( $ddl );
    2423 *     }
     24 *
     25 *     $error_count = 0;
     26 *     $tablename   = $wpdb->links;
    2527 *
    2628 *     if ( check_column( $wpdb->links, 'link_description', 'varchar( 255 )' ) ) {
     
    6365        $wpdb->query( $create_ddl );
    6466
    65         // We cannot directly tell that whether this succeeded!
     67        // We cannot directly tell whether this succeeded!
    6668        foreach ( $wpdb->get_col( 'SHOW TABLES', 0 ) as $table ) {
    6769            if ( $table === $table_name ) {
     
    101103        $wpdb->query( $create_ddl );
    102104
    103         // We cannot directly tell that whether this succeeded!
     105        // We cannot directly tell whether this succeeded!
    104106        // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names.
    105107        foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) {
     
    136138            $wpdb->query( $drop_ddl );
    137139
    138             // We cannot directly tell that whether this succeeded!
     140            // We cannot directly tell whether this succeeded!
    139141            // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names.
    140142            foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) {
     
    155157 * Uses the SQL DESC for retrieving the table info for the column. It will help
    156158 * understand the parameters, if you do more research on what column information
    157  * is returned by the SQL statement. Pass in null to skip checking that
    158  * criteria.
    159  *
    160  * Column names returned from DESC table are case sensitive and are listed:
    161  *      Field
    162  *      Type
    163  *      Null
    164  *      Key
    165  *      Default
    166  *      Extra
     159 * is returned by the SQL statement. Pass in null to skip checking that criteria.
     160 *
     161 * Column names returned from DESC table are case sensitive and are as listed:
     162 *
     163 *  - Field
     164 *  - Type
     165 *  - Null
     166 *  - Key
     167 *  - Default
     168 *  - Extra
    167169 *
    168170 * @since 1.0.0
Note: See TracChangeset for help on using the changeset viewer.