-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeactivation.php
69 lines (53 loc) · 1.37 KB
/
deactivation.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/**
* Plugin deactivation and uninstall callbacks and helpers.
*
* @package DovetailPodcasts
*/
/**
* Runs when Dovetail Podcasts is de-activated.
*
* This should clean up caches and permalinks.
*
* @return void
*/
function dovetail_podcasts_deactivation_callback() {
if ( ! dovetail_podcasts_can_load_plugin() ) {
return;
}
// Fire an action when Dovetail Podcasts is deactivating.
do_action( 'dovetail_podcasts_deactivate' );
// TODO: Flush any caches.
// TODO: Unregister content types and taxonomies?
// TODO: Flush permalinks (if we unregister content types).
}
/**
* Runs when Dovetail Podcasts is uninstalled.
*
* This cleans up data that Dovetail Podcasts stores.
*
* @return void
*/
function dovetail_podcasts_uninstall_callback() {
if ( ! dovetail_podcasts_can_load_plugin() ) {
return;
}
// Fire an action when Dovetail Podcasts is deactivating.
do_action( 'dovetail_podcasts_uninstall' );
// Delete data during deactivation.
delete_dovetail_podcasts_data();
// TODO: Delete post data for content types added by plugin?
// TODO: Delete taxonomy terms data for content types added by plugin?
}
/**
* Delete plugin data.
*
* @return void
*/
function delete_dovetail_podcasts_data() {
if ( ! class_exists( 'DovetailPodcasts' ) ) {
return;
}
// TODO: Delete all plugin settings.
do_action( 'dovetail_podcasts_delete_data' );
}