Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
Merge pull request #125 from WordPress/add/remove-data-on-uninstall
Browse files Browse the repository at this point in the history
Remove auto-updates options when plugin is uninstalled
  • Loading branch information
audrasjb authored May 13, 2020
2 parents d60eaab + 67f49f3 commit 044c092
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions wp-autoupdates.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,32 @@
* Text Domain: wp-autoupdates
*/


if ( ! defined( 'ABSPATH' ) ) {
die( 'Invalid request.' );
}


define( 'WP_AUTO_UPDATES_VERSION', '0.7.0' );


/**
* Load only when needed.
*/
if ( ! function_exists( 'wp_is_plugins_auto_update_enabled' ) ) {
include_once plugin_dir_path( __FILE__ ) . 'functions.php';
}


/**
* Remove auto-updates data on uninstall.
*/
function wp_autoupdates_activate() {
register_uninstall_hook( __FILE__, 'wp_auto_update_uninstall' );
}
register_activation_hook( __FILE__, 'wp_autoupdates_activate' );

function wp_auto_update_uninstall() {
delete_site_option( 'wp_auto_update_plugins' );
delete_site_option( 'wp_auto_update_themes' );
}

0 comments on commit 044c092

Please sign in to comment.