Closed dahuangfeng123 closed 3 years ago
Hi @dahuangfeng123 .
The plugin uses wordpress core function dbDelta. dbDelta can add or alter columns, but not drop them.
You can implement your own delete routine by hooking into acf/update_field_group
and use maybe_drop_column function:
add_action( 'acf/update_field_group', function( $field_group ) {
// Skip if the custom table is not enable
if ( !$field_group[self::SETTINGS_ENABLED]) {
return;
}
$tablename = $field_group[ACF_FICT::SETTINGS_TABLE_NAME];
// Add your code to drop columns
});
Great!
Hi guys,Here is some useful information. WordPress 5.7.2 ACF: Fields in Custom Table Version 0.5 Advanced Custom Fields Version 5.9.6
![222222222222222222](https://user-images.githubusercontent.com/3371478/119756202-c9547900-bed5-11eb-830a-29154691a6fa.PNG)