Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

proposal for a universal uninstall script to clean up after plugin is deleted #72

Open
alekseyn1 opened this issue Feb 16, 2019 · 2 comments

Comments

@alekseyn1
Copy link

Hello,
I would like to propose the following uninstall.php

if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
	exit;
}

//change your plugin prefix here
delete_options_prefixed( 'test_' );

function delete_options_prefixed( $prefix ) {
    global $wpdb;
    $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '{$prefix}%'" );
}
@jonathanbossenger
Copy link
Collaborator

Hey @alekseyn1 thanks for this.

Are you able to open a pull request with these changes. I can't guarantee I will be able to merge it very soon, but if it's open I can at least try and prioritise it.

@alekseyn1
Copy link
Author

Done :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants