Version Description
- Added support for Widget Context plugin
- Fixed notices appearing when Widget Logic plugin was enabled but filter was disabled
- Added Hide option for the Class Field Type in Settings
- Don't show any previously added IDs in front end if Show Additional Field for ID is set to No
- Don't show any previously added classes in front end if Class Field Type is set to Hide
Download this release
Release Info
Developer | elusivelight |
Plugin | Widget CSS Classes |
Version | 1.1 |
Comparing to | |
See all releases |
Code changes from version 1.0 to 1.1
- css/widget-css-classes.css +8 -8
- includes/widget-css-classes-settings.class.php +3 -2
- includes/widget-css-classes.class.php +22 -6
- js/relCopy.min.js +2 -2
- js/widget-css-classes.js +11 -11
- languages/widget-css-classes.mo +0 -0
- languages/widget-css-classes.pot +19 -15
- readme.txt +16 -4
- uninstall.php +10 -10
- widget-css-classes.php +1 -1
css/widget-css-classes.css
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
.wcssc_copy img, .wcssc_remove img {
|
2 |
-
vertical-align: middle;
|
3 |
-
margin: 0;
|
4 |
-
padding: 0;
|
5 |
-
}
|
6 |
-
|
7 |
-
.wcssc_remove img {
|
8 |
-
margin-left: -12px;
|
9 |
}
|
1 |
+
.wcssc_copy img, .wcssc_remove img {
|
2 |
+
vertical-align: middle;
|
3 |
+
margin: 0;
|
4 |
+
padding: 0;
|
5 |
+
}
|
6 |
+
|
7 |
+
.wcssc_remove img {
|
8 |
+
margin-left: -12px;
|
9 |
}
|
includes/widget-css-classes-settings.class.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Settings
|
6 |
* @author C.M. Kendrick <cindy@cleverness.org>
|
7 |
* @package widget-css-classes
|
8 |
-
* @version 1.
|
9 |
*/
|
10 |
|
11 |
/**
|
@@ -56,7 +56,8 @@ class WCSSC_Settings {
|
|
56 |
function type_option() {
|
57 |
?>
|
58 |
<input type="radio" name="<?php echo $this->general_key.'[type]'; ?>" value="1" <?php checked( $this->general_settings['type'], 1 ); ?> /> <?php esc_attr_e( 'Text', 'widget-css-classes' ); ?>
|
59 |
-
<input type="radio" name="<?php echo $this->general_key.'[type]'; ?>" value="2" <?php checked( $this->general_settings['type'], 2 ); ?> /> <?php esc_attr_e( 'Dropdown', 'widget-css-classes' );
|
|
|
60 |
<?php
|
61 |
}
|
62 |
|
5 |
* Settings
|
6 |
* @author C.M. Kendrick <cindy@cleverness.org>
|
7 |
* @package widget-css-classes
|
8 |
+
* @version 1.1
|
9 |
*/
|
10 |
|
11 |
/**
|
56 |
function type_option() {
|
57 |
?>
|
58 |
<input type="radio" name="<?php echo $this->general_key.'[type]'; ?>" value="1" <?php checked( $this->general_settings['type'], 1 ); ?> /> <?php esc_attr_e( 'Text', 'widget-css-classes' ); ?>
|
59 |
+
<input type="radio" name="<?php echo $this->general_key.'[type]'; ?>" value="2" <?php checked( $this->general_settings['type'], 2 ); ?> /> <?php esc_attr_e( 'Dropdown', 'widget-css-classes' ); ?>
|
60 |
+
<input type="radio" name="<?php echo $this->general_key.'[type]'; ?>" value="3" <?php checked( $this->general_settings['type'], 3 ); ?> /> <?php esc_attr_e( 'Hide', 'widget-css-classes' ); ?>
|
61 |
<?php
|
62 |
}
|
63 |
|
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.
|
9 |
*/
|
10 |
|
11 |
/**
|
@@ -93,21 +93,37 @@ class WCSSC {
|
|
93 |
$widget_id = $params[0]['widget_id'];
|
94 |
$widget_obj = $wp_registered_widgets[$widget_id];
|
95 |
$widget_num = $widget_obj['params'][0]['number'];
|
|
|
96 |
|
97 |
// if Widget Logic plugin is enabled, use it's callback
|
98 |
if ( in_array( 'widget-logic/widget_logic.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
|
99 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
} else {
|
101 |
$widget_opt = get_option( $widget_obj['callback'][0]->option_name );
|
102 |
}
|
103 |
|
104 |
// add classes
|
105 |
-
if (
|
106 |
-
|
|
|
|
|
107 |
|
108 |
// add id
|
109 |
-
if (
|
110 |
-
|
|
|
|
|
111 |
|
112 |
// add first, last, even, and odd classes
|
113 |
if ( !$widget_number ) {
|
5 |
* Loader
|
6 |
* @author C.M. Kendrick <cindy@cleverness.org>
|
7 |
* @package widget-css-classes
|
8 |
+
* @version 1.1
|
9 |
*/
|
10 |
|
11 |
/**
|
93 |
$widget_id = $params[0]['widget_id'];
|
94 |
$widget_obj = $wp_registered_widgets[$widget_id];
|
95 |
$widget_num = $widget_obj['params'][0]['number'];
|
96 |
+
$widget_css_classes = ( get_option( 'WCSSC_options' ) ? get_option( 'WCSSC_options' ) : array() );
|
97 |
|
98 |
// if Widget Logic plugin is enabled, use it's callback
|
99 |
if ( in_array( 'widget-logic/widget_logic.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
|
100 |
+
$widget_logic_options = get_option( 'widget_logic' );
|
101 |
+
if ( $widget_logic_options['widget_logic-options-filter'] == 'checked' ) {
|
102 |
+
$widget_opt = get_option( $widget_obj['callback_wl_redirect'][0]->option_name );
|
103 |
+
} else {
|
104 |
+
$widget_opt = get_option( $widget_obj['callback'][0]->option_name );
|
105 |
+
}
|
106 |
+
|
107 |
+
// if Widget Context plugin is enabled, use it's callback
|
108 |
+
} elseif ( in_array( 'widget-context/widget-context.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
|
109 |
+
$widget_opt = get_option( $widget_obj['callback_original_wc'][0]->option_name );
|
110 |
+
|
111 |
+
// Default callback
|
112 |
} else {
|
113 |
$widget_opt = get_option( $widget_obj['callback'][0]->option_name );
|
114 |
}
|
115 |
|
116 |
// add classes
|
117 |
+
if ( $widget_css_classes['type'] != 3 ) {
|
118 |
+
if ( isset( $widget_opt[$widget_num]['classes'] ) && !empty( $widget_opt[$widget_num]['classes'] ) )
|
119 |
+
$params[0]['before_widget'] = preg_replace( '/class="/', "class=\"{$widget_opt[$widget_num]['classes']} ", $params[0]['before_widget'], 1 );
|
120 |
+
}
|
121 |
|
122 |
// add id
|
123 |
+
if ( $widget_css_classes['show_id'] == 1 ) {
|
124 |
+
if ( isset( $widget_opt[$widget_num]['ids'] ) && !empty( $widget_opt[$widget_num]['ids'] ) )
|
125 |
+
$params[0]['before_widget'] = preg_replace( '/id="/', "id=\"{$widget_opt[$widget_num]['ids']} ", $params[0]['before_widget'], 1 );
|
126 |
+
}
|
127 |
|
128 |
// add first, last, even, and odd classes
|
129 |
if ( !$widget_number ) {
|
js/relCopy.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
(function(a){a.fn.relCopy=function(e){var b=jQuery.extend({excludeSelector:".exclude",emptySelector:".empty",copyClass:"copy",append:"",clearInputs:!0,limit:0},e);b.limit=parseInt(b.limit);this.each(function(){a(this).click(function(){var f=a(this).attr("rel"),d=a(f).length;if(0!=b.limit&&d>=b.limit)return!1;var c=a(f+":first"),e=a(c).parent(),c=a(c).clone(!0).addClass(b.copyClass+d).append(b.append);b.excludeSelector&&a(c).find(b.excludeSelector).remove();b.emptySelector&&a(c).find(b.emptySelector).empty();
|
2 |
-
if(a(c).attr("id")){var g=a(c).attr("id")+(d+1);a(c).attr("id",g)}a(c).find("[id]").each(function(){var b=a(this).attr("id")+(d+1);a(this).attr("id",b)});b.clearInputs&&a(c).find(":input").each(function(){switch(a(this).attr("type")){case "button":break;case "reset":break;case "submit":break;case "checkbox":a(this).attr("checked","");break;default:a(this).val("")}});a(e).find(f+":last").after(c);return!1})});return this}})(jQuery);
|
1 |
+
(function(a){a.fn.relCopy=function(e){var b=jQuery.extend({excludeSelector:".exclude",emptySelector:".empty",copyClass:"copy",append:"",clearInputs:!0,limit:0},e);b.limit=parseInt(b.limit);this.each(function(){a(this).click(function(){var f=a(this).attr("rel"),d=a(f).length;if(0!=b.limit&&d>=b.limit)return!1;var c=a(f+":first"),e=a(c).parent(),c=a(c).clone(!0).addClass(b.copyClass+d).append(b.append);b.excludeSelector&&a(c).find(b.excludeSelector).remove();b.emptySelector&&a(c).find(b.emptySelector).empty();
|
2 |
+
if(a(c).attr("id")){var g=a(c).attr("id")+(d+1);a(c).attr("id",g)}a(c).find("[id]").each(function(){var b=a(this).attr("id")+(d+1);a(this).attr("id",b)});b.clearInputs&&a(c).find(":input").each(function(){switch(a(this).attr("type")){case "button":break;case "reset":break;case "submit":break;case "checkbox":a(this).attr("checked","");break;default:a(this).val("")}});a(e).find(f+":last").after(c);return!1})});return this}})(jQuery);
|
js/widget-css-classes.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
-
jQuery( document ).ready( function ( $ ) {
|
2 |
-
|
3 |
-
$( '.wcssc_copy' ).relCopy( {} );
|
4 |
-
|
5 |
-
$( '.wcssc_remove' ).live( 'click', function(e) {
|
6 |
-
e.preventDefault();
|
7 |
-
$( this ).parent().slideUp( function () {
|
8 |
-
$( this ).remove();
|
9 |
-
} );
|
10 |
-
} );
|
11 |
-
|
12 |
} );
|
1 |
+
jQuery( document ).ready( function ( $ ) {
|
2 |
+
|
3 |
+
$( '.wcssc_copy' ).relCopy( {} );
|
4 |
+
|
5 |
+
$( '.wcssc_remove' ).live( 'click', function(e) {
|
6 |
+
e.preventDefault();
|
7 |
+
$( this ).parent().slideUp( function () {
|
8 |
+
$( this ).remove();
|
9 |
+
} );
|
10 |
+
} );
|
11 |
+
|
12 |
} );
|
languages/widget-css-classes.mo
ADDED
Binary file
|
languages/widget-css-classes.pot
CHANGED
@@ -2,8 +2,8 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Widget CSS Classes\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date: 2012-
|
6 |
-
"PO-Revision-Date: 2012-
|
7 |
"Last-Translator: C.M. Kendrick <cindy@cleverness.org>\n"
|
8 |
"Language-Team: <cindy@cleverness.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
@@ -63,35 +63,39 @@ msgstr ""
|
|
63 |
msgid "Dropdown"
|
64 |
msgstr ""
|
65 |
|
66 |
-
#: ../includes/widget-css-classes-settings.class.php:
|
|
|
|
|
|
|
|
|
67 |
msgid "Import/Export"
|
68 |
msgstr ""
|
69 |
|
70 |
-
#: ../includes/widget-css-classes-settings.class.php:
|
71 |
msgid "Settings Imported"
|
72 |
msgstr ""
|
73 |
|
74 |
-
#: ../includes/widget-css-classes-settings.class.php:
|
75 |
msgid "Invalid Settings File"
|
76 |
msgstr ""
|
77 |
|
78 |
-
#: ../includes/widget-css-classes-settings.class.php:
|
79 |
msgid "No Settings File Selected"
|
80 |
msgstr ""
|
81 |
|
82 |
-
#: ../includes/widget-css-classes-settings.class.php:
|
83 |
msgid "Widget CSS Classes"
|
84 |
msgstr ""
|
85 |
|
86 |
-
#: ../includes/widget-css-classes-settings.class.php:
|
87 |
msgid "Import/Export Settings"
|
88 |
msgstr ""
|
89 |
|
90 |
-
#: ../includes/widget-css-classes-settings.class.php:
|
91 |
msgid "Export Settings"
|
92 |
msgstr ""
|
93 |
|
94 |
-
#: ../includes/widget-css-classes-settings.class.php:
|
95 |
msgid "Import Settings"
|
96 |
msgstr ""
|
97 |
|
@@ -108,23 +112,23 @@ msgstr ""
|
|
108 |
msgid "Select"
|
109 |
msgstr ""
|
110 |
|
111 |
-
#: ../includes/widget-css-classes.class.php:
|
112 |
msgid "widget-"
|
113 |
msgstr ""
|
114 |
|
115 |
-
#: ../includes/widget-css-classes.class.php:
|
116 |
msgid "widget-first"
|
117 |
msgstr ""
|
118 |
|
119 |
-
#: ../includes/widget-css-classes.class.php:
|
120 |
msgid "widget-last"
|
121 |
msgstr ""
|
122 |
|
123 |
-
#: ../includes/widget-css-classes.class.php:
|
124 |
msgid "widget-even"
|
125 |
msgstr ""
|
126 |
|
127 |
-
#: ../includes/widget-css-classes.class.php:
|
128 |
msgid "widget-odd"
|
129 |
msgstr ""
|
130 |
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Widget CSS Classes\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2012-10-10 12:53-0500\n"
|
6 |
+
"PO-Revision-Date: 2012-10-10 12:53-0500\n"
|
7 |
"Last-Translator: C.M. Kendrick <cindy@cleverness.org>\n"
|
8 |
"Language-Team: <cindy@cleverness.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
63 |
msgid "Dropdown"
|
64 |
msgstr ""
|
65 |
|
66 |
+
#: ../includes/widget-css-classes-settings.class.php:60
|
67 |
+
msgid "Hide"
|
68 |
+
msgstr ""
|
69 |
+
|
70 |
+
#: ../includes/widget-css-classes-settings.class.php:92
|
71 |
msgid "Import/Export"
|
72 |
msgstr ""
|
73 |
|
74 |
+
#: ../includes/widget-css-classes-settings.class.php:97
|
75 |
msgid "Settings Imported"
|
76 |
msgstr ""
|
77 |
|
78 |
+
#: ../includes/widget-css-classes-settings.class.php:100
|
79 |
msgid "Invalid Settings File"
|
80 |
msgstr ""
|
81 |
|
82 |
+
#: ../includes/widget-css-classes-settings.class.php:103
|
83 |
msgid "No Settings File Selected"
|
84 |
msgstr ""
|
85 |
|
86 |
+
#: ../includes/widget-css-classes-settings.class.php:174
|
87 |
msgid "Widget CSS Classes"
|
88 |
msgstr ""
|
89 |
|
90 |
+
#: ../includes/widget-css-classes-settings.class.php:220
|
91 |
msgid "Import/Export Settings"
|
92 |
msgstr ""
|
93 |
|
94 |
+
#: ../includes/widget-css-classes-settings.class.php:222
|
95 |
msgid "Export Settings"
|
96 |
msgstr ""
|
97 |
|
98 |
+
#: ../includes/widget-css-classes-settings.class.php:226
|
99 |
msgid "Import Settings"
|
100 |
msgstr ""
|
101 |
|
112 |
msgid "Select"
|
113 |
msgstr ""
|
114 |
|
115 |
+
#: ../includes/widget-css-classes.class.php:143
|
116 |
msgid "widget-"
|
117 |
msgstr ""
|
118 |
|
119 |
+
#: ../includes/widget-css-classes.class.php:144
|
120 |
msgid "widget-first"
|
121 |
msgstr ""
|
122 |
|
123 |
+
#: ../includes/widget-css-classes.class.php:145
|
124 |
msgid "widget-last"
|
125 |
msgstr ""
|
126 |
|
127 |
+
#: ../includes/widget-css-classes.class.php:146
|
128 |
msgid "widget-even"
|
129 |
msgstr ""
|
130 |
|
131 |
+
#: ../includes/widget-css-classes.class.php:147
|
132 |
msgid "widget-odd"
|
133 |
msgstr ""
|
134 |
|
readme.txt
CHANGED
@@ -7,10 +7,10 @@ Tags: widgets, classes, css, widget classes, widget css
|
|
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: 3.4.
|
11 |
-
Stable tag: 1.
|
12 |
|
13 |
-
Add custom
|
14 |
|
15 |
== Description ==
|
16 |
|
@@ -35,7 +35,7 @@ Features:
|
|
35 |
* Adds number classes to widgets
|
36 |
* Fully translatable
|
37 |
* Multi-site compatible
|
38 |
-
* Compatible with Widget
|
39 |
* Has filters and hooks for customizing output including class names
|
40 |
|
41 |
[Plugin Website](http://cleverness.org/plugins/widget-css-classes/)
|
@@ -81,11 +81,21 @@ Visit [the plugin website](http://cleverness.org/plugins/widget-css-classes/) an
|
|
81 |
|
82 |
== Changelog ==
|
83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
= 1.0 =
|
85 |
* First version
|
86 |
|
87 |
== Upgrade Notice ==
|
88 |
|
|
|
|
|
|
|
89 |
= 1.0 =
|
90 |
First version
|
91 |
|
@@ -97,6 +107,8 @@ First version
|
|
97 |
|
98 |
Plus/Minus Icons from [Farm Fresh Icons](http://www.fatcow.com/free-icons) by Fat Cow Hosting
|
99 |
|
|
|
|
|
100 |
== License ==
|
101 |
|
102 |
This file is part of Widget CSS Classes.
|
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: 3.4.2
|
11 |
+
Stable tag: 1.1
|
12 |
|
13 |
+
Add custom classes and ids plus first, last, even, odd, and numbered classes to your widgets.
|
14 |
|
15 |
== Description ==
|
16 |
|
35 |
* Adds number classes to widgets
|
36 |
* Fully translatable
|
37 |
* Multi-site compatible
|
38 |
+
* Compatible with Widget Logic and Widget Context plugins
|
39 |
* Has filters and hooks for customizing output including class names
|
40 |
|
41 |
[Plugin Website](http://cleverness.org/plugins/widget-css-classes/)
|
81 |
|
82 |
== Changelog ==
|
83 |
|
84 |
+
= 1.1 =
|
85 |
+
* Added support for Widget Context plugin
|
86 |
+
* Fixed notices appearing when Widget Logic plugin was enabled but filter was disabled
|
87 |
+
* Added Hide option for the Class Field Type in Settings
|
88 |
+
* Don't show any previously added IDs in front end if Show Additional Field for ID is set to No
|
89 |
+
* Don't show any previously added classes in front end if Class Field Type is set to Hide
|
90 |
+
|
91 |
= 1.0 =
|
92 |
* First version
|
93 |
|
94 |
== Upgrade Notice ==
|
95 |
|
96 |
+
= 1.1 =
|
97 |
+
Compatibility fix, bug fix, new feature
|
98 |
+
|
99 |
= 1.0 =
|
100 |
First version
|
101 |
|
107 |
|
108 |
Plus/Minus Icons from [Farm Fresh Icons](http://www.fatcow.com/free-icons) by Fat Cow Hosting
|
109 |
|
110 |
+
Widget Context compatibility fix provided by [Joan Piedra](http://joanpiedra.com/)
|
111 |
+
|
112 |
== License ==
|
113 |
|
114 |
This file is part of Widget CSS Classes.
|
uninstall.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
<?php
|
2 |
-
if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
|
3 |
-
exit();
|
4 |
-
|
5 |
-
if ( current_user_can( 'delete_plugins' ) ) {
|
6 |
-
|
7 |
-
// delete options
|
8 |
-
delete_option( 'WCSSC_options' );
|
9 |
-
delete_option( 'WCSSC_db_version' );
|
10 |
-
|
11 |
}
|
1 |
+
<?php
|
2 |
+
if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
|
3 |
+
exit();
|
4 |
+
|
5 |
+
if ( current_user_can( 'delete_plugins' ) ) {
|
6 |
+
|
7 |
+
// delete options
|
8 |
+
delete_option( 'WCSSC_options' );
|
9 |
+
delete_option( 'WCSSC_db_version' );
|
10 |
+
|
11 |
}
|
widget-css-classes.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Widget CSS Classes
|
4 |
-
Version: 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
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Widget CSS Classes
|
4 |
+
Version: 1.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
|