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

Remove auto-updates options when plugin is uninstalled #125

Merged
merged 1 commit into from
May 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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' );
}