... | ... |
@@ -35,7 +35,7 @@ class Rucy_Class { |
35 | 35 |
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'add_setting_link' ) ); |
36 | 36 |
$setting = new Class_Rucy_Setting(); |
37 | 37 |
add_action( 'admin_menu', array( $setting, 'set_admin_menu' ) ); |
38 |
- add_action( 'admin_notices', array( $setting, 'set_admin_notices' ) ); |
|
38 |
+ add_action( 'admin_init', array( $setting, 'setting_init' ) ); |
|
39 | 39 |
$editor = new Class_Rucy_Editer(); |
40 | 40 |
add_action( 'admin_menu', array( $editor, 'add_rucy_metabox' ) ); |
41 | 41 |
add_action( 'save_post', array( $editor, 'save_rc_post_meta' ) ); |
... | ... |
@@ -54,8 +54,6 @@ class Rucy_Class { |
54 | 54 |
add_action( RC_CRON_HOOK, array( $cron, 'update_rc_reserved_content' ) ); |
55 | 55 |
// deactivation this plugin |
56 | 56 |
register_deactivation_hook( __FILE__ , array( $this, 'uninstall_rucy' ) ); |
57 |
- // uninstall this plugin |
|
58 |
- register_uninstall_hook( __FILE__, array( $this, 'uninstall_rucy' ) ); |
|
59 | 57 |
} |
60 | 58 |
|
61 | 59 |
public function activate_plugin() { |
... | ... |
@@ -124,7 +122,7 @@ class Rucy_Class { |
124 | 124 |
public function uninstall_rucy() { |
125 | 125 |
wp_clear_scheduled_hook( RC_CRON_HOOK ); |
126 | 126 |
delete_option( RC_SETTING_OPTION_KEY ); |
127 |
- delete_option( RC_VERSION ); |
|
127 |
+ delete_option( 'rucy_version' ); |
|
128 | 128 |
$all_posts = get_posts( 'numberposts=-1&post_status=' ); |
129 | 129 |
$component = new Class_Rucy_Component(); |
130 | 130 |
$post_meta_keys = $component->get_post_meta_keys(); |
131 | 131 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,29 @@ |
0 |
+<?php |
|
1 |
+/** |
|
2 |
+ * uninstall this plugin. |
|
3 |
+ */ |
|
4 |
+if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
|
5 |
+ exit(); |
|
6 |
+} |
|
7 |
+ |
|
8 |
+wp_clear_scheduled_hook( 'rucy_update_reserved_content' ); |
|
9 |
+delete_option( 'rucy_post_type' ); |
|
10 |
+delete_option( 'rucy_version' ); |
|
11 |
+$all_posts = get_posts( 'numberposts=-1&post_status=' ); |
|
12 |
+$rc_post_meta_keys = array( |
|
13 |
+ 'rc_reserv_accept', |
|
14 |
+ 'rc_reserv_content', |
|
15 |
+ 'rc_reserv_date', |
|
16 |
+ 'rc_reserv_feature_image', |
|
17 |
+ 'rc_reserv_accept_feature_image', |
|
18 |
+ 'rc_reserv_accept_post_update', |
|
19 |
+ 'rc_rollback_accept', |
|
20 |
+ 'rc_rollback_date', |
|
21 |
+ 'rc_rollback_accept_update_date', |
|
22 |
+ 'rc_rollback_accept_feature_image', |
|
23 |
+); |
|
24 |
+foreach ( $all_posts as $post_info ) { |
|
25 |
+ foreach ( $rc_post_meta_keys as $key ) { |
|
26 |
+ delete_post_meta( $post_info->ID, $key ); |
|
27 |
+ } |
|
28 |
+} |
|
0 | 29 |
\ No newline at end of file |