The core library adds a "Remove all plugin data on uninstall" setting on the settings page, even though the plugin might not actually hook register_uninstall_hook() or contain a uninstall.php file. When checked, users can expect the plugin data being removed on uninstall, while nothing will be removed if there are no uninstall methods implemented.
|
register_setting( |
|
'pronamic_pay', |
|
'pronamic_pay_uninstall_clear_data', |
|
[ |
|
'type' => 'boolean', |
|
'default' => false, |
|
] |
|
); |
|
// Remove data on uninstall. |
|
add_settings_field( |
|
'pronamic_pay_uninstall_clear_data', |
|
__( 'Remove Data', 'pronamic_ideal' ), |
|
[ $this, 'input_checkbox' ], |
|
'pronamic_pay', |
|
'pronamic_pay_general', |
|
[ |
|
'legend' => __( 'Remove Data', 'pronamic_ideal' ), |
|
'description' => __( 'Remove all plugin data on uninstall', 'pronamic_ideal' ), |
|
'label_for' => 'pronamic_pay_uninstall_clear_data', |
|
'classes' => 'regular-text', |
|
'type' => 'checkbox', |
|
] |
|
); |
The core library adds a "Remove all plugin data on uninstall" setting on the settings page, even though the plugin might not actually hook
register_uninstall_hook()or contain auninstall.phpfile. When checked, users can expect the plugin data being removed on uninstall, while nothing will be removed if there are no uninstall methods implemented.wp-pay-core/src/Settings.php
Lines 68 to 75 in 6bb8284
wp-pay-core/src/Admin/AdminSettings.php
Lines 73 to 87 in 6bb8284