Ticket #26801: 26801.diff
File 26801.diff, 1.0 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/upgrade.php
1613 1613 $cfields[strtolower($fieldname)] = trim($fld, ", \n"); 1614 1614 } 1615 1615 } 1616 1617 // Check if columns that don't exist in the creation queries should be dropped 1618 $drop_columns = apply_filters( 'dbdelta_drop_columns', false ); 1616 1619 1617 1620 // For every field in the table 1618 1621 foreach ($tablefields as $tablefield) { … … 1643 1646 // Remove the field from the array (so it's not added) 1644 1647 unset($cfields[strtolower($tablefield->Field)]); 1645 1648 } else { 1646 // This field exists in the table, but not in the creation queries? 1649 // This field exists in the table, but not in the creation queries 1650 if ( $drop_columns ) { 1651 $cqueries[] = "ALTER TABLE {$table} DROP COLUMN {$tablefield->Field}"; 1652 $for_update[$table.'.'.$tablefield->Field] = "Dropped {$table}.{$tablefield->Field}"; 1653 } 1647 1654 } 1648 1655 } 1649 1656