Skip to content

Commit

Permalink
final plugin with uninstallation hook
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleBlanchette committed Nov 6, 2024
1 parent 0df665f commit be97d18
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,10 @@ function wp_learn_custom_table_update_db_check() {
wp_learn_custom_table_create_submissions_table();
}
}

register_uninstall_hook( __FILE__, 'wp_learn_custom_table_delete_submissions_table' );
function wp_learn_custom_table_delete_submissions_table() {
global $wpdb;
$wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}wpl_submissions" );
delete_option( 'wp_learn_custom_table_db_version' );
}

0 comments on commit be97d18

Please sign in to comment.