We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9864614 commit a27dddcCopy full SHA for a27dddc
1 file changed
uninstall.php
@@ -2,4 +2,23 @@
2
3
defined('WP_UNINSTALL_PLUGIN') || exit;
4
5
-// silence is golden
+// Remove widget instances
6
+delete_option('widget_latest-post-widget');
7
+
8
+// Cleanup sidebar assignments
9
+$sidebars = get_option('sidebar_widgets');
10
+if (is_array($sidebars)) {
11
+ foreach ($sidebars as $sidebar => $widgets) {
12
+ if (is_array($widget)) {
13
+ $sidebars[$sidebar] = array_filter($widgets, function ($widget) {
14
+ return strpos($widget, 'latest-post-widget') != 0;
15
+ });
16
+ }
17
18
+ update_option($sidebars);
19
+}
20
+// Clear any transients plugin might have created
21
+delete_transient('latest_post_widget_errors');
22
23
+// Clear object name
24
+wp_cache_flush();
0 commit comments