Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Remove all plugin data' setting not working without uninstall method #177

Open
rvdsteege opened this issue Apr 3, 2024 · 0 comments
Open
Labels

Comments

@rvdsteege
Copy link
Member

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',
]
);

@rvdsteege rvdsteege added the bug label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

1 participant