@@ 249-268 (lines=20) @@ | ||
246 | global $wpdb; |
|
247 | ||
248 | // Make sure it is only a single site we are resetting. |
|
249 | if ( ! is_multisite() ) { |
|
250 | // Delete options |
|
251 | $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'auto_load_next_post_%'"); |
|
252 | ||
253 | // Delete user interactions |
|
254 | $wpdb->query("DELETE FROM $wpdb->usermeta WHERE meta_key LIKE 'auto_load_next_post_%'"); |
|
255 | ||
256 | // Delete Uninstall Data - Just to double check it has been removed. |
|
257 | delete_option( 'auto_load_next_post_uninstall_data' ); |
|
258 | ||
259 | // Delete Install Date |
|
260 | delete_option( 'auto_load_next_post_install_date' ); |
|
261 | } |
|
262 | else { |
|
263 | // Delete Uninstall Data |
|
264 | delete_site_option( 'auto_load_next_post_uninstall_data' ); |
|
265 | ||
266 | // Delete Install Date |
|
267 | delete_site_option( 'auto_load_next_post_install_date' ); |
|
268 | } |
|
269 | ||
270 | // Re-install Auto Load Next Post |
|
271 | self::install(); |
@@ 20-43 (lines=24) @@ | ||
17 | ||
18 | $uninstall = get_option( 'auto_load_next_post_uninstall_data' ); |
|
19 | ||
20 | if ( ! empty( $uninstall ) ) { |
|
21 | ||
22 | // Make sure it is only a single site we are uninstalling from. |
|
23 | if ( ! is_multisite() ) { |
|
24 | // Delete options |
|
25 | $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'auto_load_next_post_%'"); |
|
26 | ||
27 | // Delete user interactions |
|
28 | $wpdb->query("DELETE FROM $wpdb->usermeta WHERE meta_key LIKE 'auto_load_next_post_%'"); |
|
29 | ||
30 | // Delete Uninstall Data - Just to double check it has been removed. |
|
31 | delete_option( 'auto_load_next_post_uninstall_data' ); |
|
32 | ||
33 | // Delete Install Date |
|
34 | delete_option( 'auto_load_next_post_install_date' ); |
|
35 | } |
|
36 | else { |
|
37 | // Delete Uninstall Data |
|
38 | delete_site_option( 'auto_load_next_post_uninstall_data' ); |
|
39 | ||
40 | // Delete Install Date |
|
41 | delete_site_option( 'auto_load_next_post_install_date' ); |
|
42 | } |
|
43 | } |
|
44 | ||
45 | // Clear any cached data that has been removed. |
|
46 | wp_cache_flush(); |