Changeset 54859 for trunk/src/wp-admin/install-helper.php
- Timestamp:
- 11/20/2022 02:08:38 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/install-helper.php
r54858 r54859 1 1 <?php 2 2 /** 3 * Plugins may load this file to gain access to special helper functions for4 * plugin installation. This file is not included by WordPress and it is3 * 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 5 5 * recommended, to prevent fatal errors, that this file is included using 6 6 * require_once. … … 8 8 * These functions are not optimized for speed, but they should only be used 9 9 * 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 you11 * 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. 12 12 * 13 13 * check_column( 'wp_links', 'link_description', 'mediumtext' ); 14 * 14 15 * if ( check_column( $wpdb->comments, 'comment_author', 'tinytext' ) ) { 15 16 * echo "ok\n"; 16 17 * } 17 18 * 18 * $error_count = 0;19 * $tablename = $wpdb->links;20 19 * // Check the column. 21 20 * if ( ! check_column( $wpdb->links, 'link_description', 'varchar( 255 )' ) ) { … … 23 22 * $q = $wpdb->query( $ddl ); 24 23 * } 24 * 25 * $error_count = 0; 26 * $tablename = $wpdb->links; 25 27 * 26 28 * if ( check_column( $wpdb->links, 'link_description', 'varchar( 255 )' ) ) { … … 63 65 $wpdb->query( $create_ddl ); 64 66 65 // We cannot directly tell thatwhether this succeeded!67 // We cannot directly tell whether this succeeded! 66 68 foreach ( $wpdb->get_col( 'SHOW TABLES', 0 ) as $table ) { 67 69 if ( $table === $table_name ) { … … 101 103 $wpdb->query( $create_ddl ); 102 104 103 // We cannot directly tell thatwhether this succeeded!105 // We cannot directly tell whether this succeeded! 104 106 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names. 105 107 foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { … … 136 138 $wpdb->query( $drop_ddl ); 137 139 138 // We cannot directly tell thatwhether this succeeded!140 // We cannot directly tell whether this succeeded! 139 141 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names. 140 142 foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { … … 155 157 * Uses the SQL DESC for retrieving the table info for the column. It will help 156 158 * 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 * 162 * 163 * 164 * 165 * 166 * 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 167 169 * 168 170 * @since 1.0.0
Note: See TracChangeset
for help on using the changeset viewer.