wp/wp-admin/install-helper.php
changeset 19 3d72ae0968f4
parent 16 a86126ab1dd4
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
   160  *
   160  *
   161  * @since 1.0.0
   161  * @since 1.0.0
   162  *
   162  *
   163  * @global wpdb $wpdb WordPress database abstraction object.
   163  * @global wpdb $wpdb WordPress database abstraction object.
   164  *
   164  *
   165  * @param string $table_name Database table name.
   165  * @param string $table_name    Database table name.
   166  * @param string $col_name   Table column name.
   166  * @param string $col_name      Table column name.
   167  * @param string $col_type   Table column type.
   167  * @param string $col_type      Table column type.
   168  * @param bool   $is_null    Optional. Check is null.
   168  * @param bool   $is_null       Optional. Check is null.
   169  * @param mixed  $key        Optional. Key info.
   169  * @param mixed  $key           Optional. Key info.
   170  * @param mixed  $default    Optional. Default value.
   170  * @param mixed  $default_value Optional. Default value.
   171  * @param mixed  $extra      Optional. Extra value.
   171  * @param mixed  $extra         Optional. Extra value.
   172  * @return bool True, if matches. False, if not matching.
   172  * @return bool True, if matches. False, if not matching.
   173  */
   173  */
   174 function check_column( $table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null ) {
   174 function check_column( $table_name, $col_name, $col_type, $is_null = null, $key = null, $default_value = null, $extra = null ) {
   175 	global $wpdb;
   175 	global $wpdb;
   176 
   176 
   177 	$diffs   = 0;
   177 	$diffs   = 0;
   178 	$results = $wpdb->get_results( "DESC $table_name" );
   178 	$results = $wpdb->get_results( "DESC $table_name" );
   179 
   179 
   189 				++$diffs;
   189 				++$diffs;
   190 			}
   190 			}
   191 			if ( ( null !== $key ) && ( $row->Key !== $key ) ) {
   191 			if ( ( null !== $key ) && ( $row->Key !== $key ) ) {
   192 				++$diffs;
   192 				++$diffs;
   193 			}
   193 			}
   194 			if ( ( null !== $default ) && ( $row->Default !== $default ) ) {
   194 			if ( ( null !== $default_value ) && ( $row->Default !== $default_value ) ) {
   195 				++$diffs;
   195 				++$diffs;
   196 			}
   196 			}
   197 			if ( ( null !== $extra ) && ( $row->Extra !== $extra ) ) {
   197 			if ( ( null !== $extra ) && ( $row->Extra !== $extra ) ) {
   198 				++$diffs;
   198 				++$diffs;
   199 			}
   199 			}