Skip to content

Commit 9571c41

Browse files
committed
Merge branch 'develop' of github.com:Emilia-Capital/aaa-option-optimizer into develop
2 parents d4a5dc6 + d01319e commit 9571c41

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

aaa-option-optimizer.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
require_once __DIR__ . '/src/autoload.php';
2525

2626
register_activation_hook( __FILE__, 'aaa_option_optimizer_activation' );
27+
register_deactivation_hook( __FILE__, 'aaa_option_optimizer_deactivation' );
2728

2829
/**
2930
* Activation hooked function to store start stats.
@@ -53,6 +54,16 @@ function aaa_option_optimizer_activation() {
5354
);
5455
}
5556

57+
/**
58+
* Deactivation hooked function to remove autoload from the plugin option.
59+
*
60+
* @return void
61+
*/
62+
function aaa_option_optimizer_deactivation() {
63+
$aaa_option_value = get_option( 'option_optimizer' );
64+
update_option( 'option_optimizer', $aaa_option_value, false );
65+
}
66+
5667
/**
5768
* Initializes the plugin.
5869
*

uninstall.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
/**
3+
* Uninstall the plugin.
4+
*
5+
* Delete the plugin option.
6+
*
7+
* @package Progress_Planner
8+
*/
9+
10+
// If uninstall not called from WordPress, then exit.
11+
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
12+
exit;
13+
}
14+
15+
// Delete the plugin option.
16+
delete_option( 'option_optimizer' );

0 commit comments

Comments
 (0)