Widget CSS Classes - Version 1.5.1

Version Description

  • Fix: Widget Logic widget_content filter compatibility. #27
  • Enhancement: Make uninstall script compatible with network installations.
Download this release

Release Info

Developer keraweb
Plugin Icon 128x128 Widget CSS Classes
Version 1.5.1
Comparing to
See all releases

Code changes from version 1.5.0 to 1.5.1

README.md CHANGED
@@ -1,5 +1,7 @@
1
  # Widget CSS Classes
2
 
 
 
3
  [![WordPress Plugin version](https://img.shields.io/wordpress/plugin/v/widget-css-classes.svg?style=flat)](https://wordpress.org/plugins/widget-css-classes/)
4
  [![WordPress Plugin WP tested version](https://img.shields.io/wordpress/v/widget-css-classes.svg?style=flat)](https://wordpress.org/plugins/widget-css-classes/)
5
  [![WordPress Plugin downloads](https://img.shields.io/wordpress/plugin/dt/widget-css-classes.svg?style=flat)](https://wordpress.org/plugins/widget-css-classes/)
1
  # Widget CSS Classes
2
 
3
+ Add custom classes and ids plus first, last, even, odd, and numbered classes to your widgets.
4
+
5
  [![WordPress Plugin version](https://img.shields.io/wordpress/plugin/v/widget-css-classes.svg?style=flat)](https://wordpress.org/plugins/widget-css-classes/)
6
  [![WordPress Plugin WP tested version](https://img.shields.io/wordpress/v/widget-css-classes.svg?style=flat)](https://wordpress.org/plugins/widget-css-classes/)
7
  [![WordPress Plugin downloads](https://img.shields.io/wordpress/plugin/dt/widget-css-classes.svg?style=flat)](https://wordpress.org/plugins/widget-css-classes/)
includes/widget-css-classes.class.php CHANGED
@@ -5,7 +5,7 @@
5
  * Loader
6
  * @author C.M. Kendrick <cindy@cleverness.org>
7
  * @package widget-css-classes
8
- * @version 1.5.0
9
  */
10
 
11
  /**
@@ -647,7 +647,7 @@ class WCSSC {
647
  // If Widget Logic plugin is enabled, use it's callback
648
  if ( in_array( 'widget-logic/widget_logic.php', $active_plugins, true ) ) {
649
  $widget_logic_options = get_option( 'widget_logic' );
650
- if ( isset( $widget_logic_options['widget_logic-options-filter'] ) && 'checked' === $widget_logic_options['widget_logic-options-filter'] ) {
651
  $widget_opt = get_option( $widget_obj['callback_wl_redirect'][0]->option_name );
652
  } else {
653
  $widget_opt = get_option( $widget_obj['callback'][0]->option_name );
5
  * Loader
6
  * @author C.M. Kendrick <cindy@cleverness.org>
7
  * @package widget-css-classes
8
+ * @version 1.5.1
9
  */
10
 
11
  /**
647
  // If Widget Logic plugin is enabled, use it's callback
648
  if ( in_array( 'widget-logic/widget_logic.php', $active_plugins, true ) ) {
649
  $widget_logic_options = get_option( 'widget_logic' );
650
+ if ( ! empty( $widget_logic_options['widget_logic-options-filter'] ) ) {
651
  $widget_opt = get_option( $widget_obj['callback_wl_redirect'][0]->option_name );
652
  } else {
653
  $widget_opt = get_option( $widget_obj['callback'][0]->option_name );
readme.txt CHANGED
@@ -8,7 +8,7 @@ License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Requires at least: 3.3
10
  Tested up to: 4.8
11
- Stable tag: 1.5.0
12
 
13
  Add custom classes and ids plus first, last, even, odd, and numbered classes to your widgets.
14
 
@@ -94,6 +94,10 @@ Visit [the plugin website](http://cleverness.org/plugins/widget-css-classes/) an
94
 
95
  == Changelog ==
96
 
 
 
 
 
97
  = 1.5.0 =
98
  * **Feature:** Option to try and fix the widget parameters if they are invalid. [#24](https://github.com/cleverness/widget-css-classes/issues/24)
99
  * **Feature:** Option to remove duplicate classes. [#25](https://github.com/cleverness/widget-css-classes/issues/25)
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Requires at least: 3.3
10
  Tested up to: 4.8
11
+ Stable tag: 1.5.1
12
 
13
  Add custom classes and ids plus first, last, even, odd, and numbered classes to your widgets.
14
 
94
 
95
  == Changelog ==
96
 
97
+ = 1.5.1 =
98
+ * **Fix:** Widget Logic `widget_content` filter compatibility. [#27](https://github.com/cleverness/widget-css-classes/issues/27)
99
+ * **Enhancement:** Make uninstall script compatible with network installations.
100
+
101
  = 1.5.0 =
102
  * **Feature:** Option to try and fix the widget parameters if they are invalid. [#24](https://github.com/cleverness/widget-css-classes/issues/24)
103
  * **Feature:** Option to remove duplicate classes. [#25](https://github.com/cleverness/widget-css-classes/issues/25)
uninstall.php CHANGED
@@ -1,12 +1,56 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
2
  if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
3
  die();
4
  }
5
 
6
- if ( current_user_can( 'delete_plugins' ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
- // delete options
9
- delete_option( 'WCSSC_options' );
10
- delete_option( 'WCSSC_db_version' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
  }
1
  <?php
2
+ /**
3
+ * Widget CSS Classes plugin uninstall
4
+ *
5
+ * Uninstall
6
+ * @author Jory Hogeveen <info@keraweb.nl>
7
+ * @package widget-css-classes
8
+ * @version 1.5.1
9
+ * @todo Uninstall for multi-networks
10
+ */
11
+
12
+ //if uninstall not called from WordPress exit
13
  if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
14
  die();
15
  }
16
 
17
+ wcssc_uninstall();
18
+
19
+ if ( is_multisite() ) {
20
+ global $wp_version;
21
+ if ( version_compare( $wp_version, '4.5.999', '<' ) ) {
22
+ // @codingStandardsIgnoreLine - Sadly does not work for large networks -> return false
23
+ $blogs = wp_get_sites();
24
+ } else {
25
+ $blogs = get_sites();
26
+ }
27
+ if ( ! empty( $blogs ) ) {
28
+ foreach ( $blogs as $blog ) {
29
+ $blog = (array) $blog;
30
+ wcssc_uninstall( intval( $blog['blog_id'] ) );
31
+ }
32
+ wcssc_uninstall( 'site' );
33
+ }
34
+ }
35
+
36
+ function wcssc_uninstall( $blog_id = false ) {
37
 
38
+ // Delete all options
39
+ $option_keys = array( 'WCSSC_options', 'WCSSC_db_version' );
40
+ if ( $blog_id ) {
41
+ if ( 'site' === $blog_id ) {
42
+ foreach ( $option_keys as $option_key ) {
43
+ delete_site_option( $option_key );
44
+ }
45
+ } else {
46
+ foreach ( $option_keys as $option_key ) {
47
+ delete_blog_option( $blog_id, $option_key );
48
+ }
49
+ }
50
+ } else {
51
+ foreach ( $option_keys as $option_key ) {
52
+ delete_option( $option_key );
53
+ }
54
+ }
55
 
56
  }
widget-css-classes.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Plugin Name: Widget CSS Classes
4
- * Version: 1.5.0
5
  * Description: Add custom, first, last, even, odd, and numbered classes to your widgets.
6
  * Author: C.M. Kendrick
7
  * Author URI: http://cleverness.org
@@ -27,7 +27,7 @@ function widget_css_classes_loader() {
27
 
28
  if ( is_admin() ) {
29
 
30
- if ( ! defined( 'WCSSC_PLUGIN_VERSION' ) ) define( 'WCSSC_PLUGIN_VERSION', '1.5.0' );
31
  if ( ! defined( 'WCSSC_FILE' ) ) define( 'WCSSC_FILE', __FILE__ );
32
  if ( ! defined( 'WCSSC_BASENAME' ) ) define( 'WCSSC_BASENAME', plugin_basename( __FILE__ ) );
33
  if ( ! defined( 'WCSSC_PLUGIN_DIR' ) ) define( 'WCSSC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
1
  <?php
2
  /**
3
  * Plugin Name: Widget CSS Classes
4
+ * Version: 1.5.1
5
  * Description: Add custom, first, last, even, odd, and numbered classes to your widgets.
6
  * Author: C.M. Kendrick
7
  * Author URI: http://cleverness.org
27
 
28
  if ( is_admin() ) {
29
 
30
+ if ( ! defined( 'WCSSC_PLUGIN_VERSION' ) ) define( 'WCSSC_PLUGIN_VERSION', '1.5.1' );
31
  if ( ! defined( 'WCSSC_FILE' ) ) define( 'WCSSC_FILE', __FILE__ );
32
  if ( ! defined( 'WCSSC_BASENAME' ) ) define( 'WCSSC_BASENAME', plugin_basename( __FILE__ ) );
33
  if ( ! defined( 'WCSSC_PLUGIN_DIR' ) ) define( 'WCSSC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );