Styles - Version 1.0.7

Version Description

  • Fix: Clearing a setting now updates the preview without a page refresh.
  • Fix: Settings requiring "!important" are fixed and support live preview.
  • Fix: Plugin header settings no longer conflicts with other plugins.
  • Fix: Remove all options when uninstalling on a site network.
  • Change: 'color' label now says 'text color'.
  • New: Contact links and developer resources added to readme
Download this release

Release Info

Developer pdclark
Plugin Icon Styles
Version 1.0.7
Comparing to
See all releases

Code changes from version 1.0.6 to 1.0.7

classes/styles-child.php CHANGED
@@ -34,8 +34,12 @@ class Styles_Child {
34
  *
35
  * @return array plugin header search terms
36
  */
37
- public function extra_plugin_headers() {
38
- return array( 'styles class', 'styles item', 'styles updates' );
 
 
 
 
39
  }
40
 
41
  /**
34
  *
35
  * @return array plugin header search terms
36
  */
37
+ public function extra_plugin_headers( $headers ) {
38
+ $headers['Styles Class'] = 'styles class';
39
+ $headers['Styles Item'] = 'styles item';
40
+ $headers['Styles Updates'] = 'styles updates';
41
+
42
+ return $headers;
43
  }
44
 
45
  /**
classes/styles-control-color.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  class Styles_Control_Color extends Styles_Control {
4
- var $suffix = 'color';
5
  var $template = '$selector { color: $value; }';
6
 
7
  public function __construct( $group, $element ) {
1
  <?php
2
 
3
  class Styles_Control_Color extends Styles_Control {
4
+ var $suffix = 'text color';
5
  var $template = '$selector { color: $value; }';
6
 
7
  public function __construct( $group, $element ) {
classes/styles-control.php CHANGED
@@ -42,6 +42,7 @@ abstract class Styles_Control {
42
  $this->priority = @ $element['priority'];
43
 
44
  $this->append_suffix_to_label();
 
45
 
46
  $this->id = $this->get_element_id(); // must call append_suffix_to_label first
47
  $this->setting = $this->get_setting_id(); // must call append_suffix_to_label first
@@ -93,6 +94,16 @@ abstract class Styles_Control {
93
 
94
  }
95
 
 
 
 
 
 
 
 
 
 
 
96
  /**
97
  * @param array $element Values related to this control, like CSS selector and control type
98
  * @return string Unique, sanatized ID for this element based on label and type
42
  $this->priority = @ $element['priority'];
43
 
44
  $this->append_suffix_to_label();
45
+ $this->maybe_add_important_to_template();
46
 
47
  $this->id = $this->get_element_id(); // must call append_suffix_to_label first
48
  $this->setting = $this->get_setting_id(); // must call append_suffix_to_label first
94
 
95
  }
96
 
97
+ /**
98
+ * If important is set to "true" in the element JSON,
99
+ * add !important to CSS template
100
+ */
101
+ public function maybe_add_important_to_template() {
102
+ if ( isset( $this->element['important'] ) && !empty( $this->element['important'] ) ) {
103
+ $this->template = str_replace( ';', ' !important;', $this->template );
104
+ }
105
+ }
106
+
107
  /**
108
  * @param array $element Values related to this control, like CSS selector and control type
109
  * @return string Unique, sanatized ID for this element based on label and type
classes/styles-plugin.php CHANGED
@@ -12,7 +12,7 @@ class Styles_Plugin {
12
  *
13
  * @var string
14
  **/
15
- var $version = '1.0.5';
16
 
17
  /**
18
  * Plugin DB version
12
  *
13
  * @var string
14
  **/
15
+ var $version = '1.0.7';
16
 
17
  /**
18
  * Plugin DB version
js/post-message-part-background-color.js CHANGED
@@ -1,5 +1,6 @@
1
  wp.customize( '@setting@', function( value ) {
2
  value.bind( function( newval ) {
 
3
  $('@selector@').css('background-color', newval );
4
  } );
5
  } );
1
  wp.customize( '@setting@', function( value ) {
2
  value.bind( function( newval ) {
3
+ if ( false == newval ) { newval = ''; }
4
  $('@selector@').css('background-color', newval );
5
  } );
6
  } );
js/post-message-part-border-color.js CHANGED
@@ -1,5 +1,6 @@
1
  wp.customize( '@setting@', function( value ) {
2
  value.bind( function( newval ) {
 
3
  $('@selector@').css('@property@', newval );
4
  } );
5
  } );
1
  wp.customize( '@setting@', function( value ) {
2
  value.bind( function( newval ) {
3
+ if ( false == newval ) { newval = ''; }
4
  $('@selector@').css('@property@', newval );
5
  } );
6
  } );
js/post-message-part-color.js CHANGED
@@ -1,5 +1,6 @@
1
  wp.customize( '@setting@', function( value ) {
2
  value.bind( function( newval ) {
 
3
  $('@selector@').css('color', newval );
4
  } );
5
  } );
1
  wp.customize( '@setting@', function( value ) {
2
  value.bind( function( newval ) {
3
+ if ( false == newval ) { newval = ''; }
4
  $('@selector@').css('color', newval );
5
  } );
6
  } );
js/post-message-part-text.js CHANGED
@@ -1,5 +1,6 @@
1
  wp.customize( '@setting_font_size@', function( value ) {
2
  value.bind( function( newval ) {
3
- $('@selector@').css('font-size', newval + 'px' );
 
4
  } );
5
  } );
1
  wp.customize( '@setting_font_size@', function( value ) {
2
  value.bind( function( newval ) {
3
+ if ( false == newval ) { newval = ''; }else { newval = newval + 'px' }
4
+ $('@selector@').css('font-size', newval );
5
  } );
6
  } );
readme.txt CHANGED
@@ -2,10 +2,10 @@
2
  Contributors: brainstormmedia, pdclark, elusivelight
3
  Plugin URI: http://stylesplugin.com
4
  Author URI: http://brainstormmedia.com
5
- Tags: css, stylesheet, styles, appearance, customize, customizer, colors, color picker, images, image upload, background, fonts, google fonts, user interface, twentyten, twentyeleven, twentytwelve, twentythirteen
6
  Requires at least: 3.4
7
  Tested up to: 3.5.2
8
- Stable tag: 1.0.6
9
 
10
  Be creative with colors and fonts. Styles changes everything.
11
 
@@ -13,11 +13,11 @@ Be creative with colors and fonts. Styles changes everything.
13
 
14
  WordPress has lots of beautiful themes, but personalizing a design can be difficult and time-intensive. Styles changes that. Styles gives you creative control in one consistent interface – the WordPress theme customizer. Styles lets you make your site your own. :)
15
 
16
- http://www.youtube.com/watch?v=DsQPfX92IgY
17
 
18
  [Try a demo in TwentyTwelve](http://demo.stylesplugin.com/twentytwelve).
19
 
20
- **Features of the plugin include:**
21
 
22
  * Instant previews
23
  * Text size
@@ -31,19 +31,31 @@ http://www.youtube.com/watch?v=DsQPfX92IgY
31
 
32
  Styles and options for all built-in WordPress themes are free. More themes are available at [StylesPlugin.com](http://stylesplugin.com).
33
 
34
- **Free Themes include:**
35
 
36
  * TwentyTen: [Demo](http://demo.stylesplugin.com/twentyten)
37
  * TwentyEleven: [Demo](http://demo.stylesplugin.com/twentyeleven)
38
  * TwentyTwelve: [Demo](http://demo.stylesplugin.com/twentytwelve)
39
  * TwentyThirteen: [Demo](http://demo.stylesplugin.com/twentythirteen)
40
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  == Installation ==
42
 
43
- 1. Upload the `styles` folder to the `/wp-content/plugins/` directory
44
- 1. Activate the plugin through the 'Plugins' menu in WordPress
45
- 1. Install an additional plugin for your current theme.
46
- 1. Edit your site under `Appearance > Customize`
47
 
48
  == Screenshots ==
49
 
@@ -64,7 +76,13 @@ We believe life is better when we work together. :) Support for WordPress defaul
64
 
65
  = Does Styles support my theme? =
66
 
67
- Maybe! We have additional themes available available at [StylesPlugin.com](http://stylesplugin.com). If you don't find your theme there, we also have documentation on how to create options using styles available for developers. Adding one option takes only one line of code.
 
 
 
 
 
 
68
 
69
  = Will this plugin slow down my site? =
70
 
@@ -72,6 +90,15 @@ No! Styles is very careful about only loading what is needed to get its job done
72
 
73
  == Changelog ==
74
 
 
 
 
 
 
 
 
 
 
75
  = 1.0.6 =
76
  * New: Add installation notice to Customizer.
77
 
@@ -131,4 +158,9 @@ No! Styles is very careful about only loading what is needed to get its job done
131
 
132
  == Upgrade Notice ==
133
 
134
- Add installation notice to Customizer.
 
 
 
 
 
2
  Contributors: brainstormmedia, pdclark, elusivelight
3
  Plugin URI: http://stylesplugin.com
4
  Author URI: http://brainstormmedia.com
5
+ Tags: css, stylesheet, appearance, customize, customizer, colors, color picker, background, fonts, google fonts, user interface, twenty ten, twenty eleven, twenty twelve, twenty thirteen
6
  Requires at least: 3.4
7
  Tested up to: 3.5.2
8
+ Stable tag: 1.0.7
9
 
10
  Be creative with colors and fonts. Styles changes everything.
11
 
13
 
14
  WordPress has lots of beautiful themes, but personalizing a design can be difficult and time-intensive. Styles changes that. Styles gives you creative control in one consistent interface – the WordPress theme customizer. Styles lets you make your site your own. :)
15
 
16
+ http://youtube.com/watch?v=CpKiZEqpcr8
17
 
18
  [Try a demo in TwentyTwelve](http://demo.stylesplugin.com/twentytwelve).
19
 
20
+ **Features of the plugin**
21
 
22
  * Instant previews
23
  * Text size
31
 
32
  Styles and options for all built-in WordPress themes are free. More themes are available at [StylesPlugin.com](http://stylesplugin.com).
33
 
34
+ **Free Themes**
35
 
36
  * TwentyTen: [Demo](http://demo.stylesplugin.com/twentyten)
37
  * TwentyEleven: [Demo](http://demo.stylesplugin.com/twentyeleven)
38
  * TwentyTwelve: [Demo](http://demo.stylesplugin.com/twentytwelve)
39
  * TwentyThirteen: [Demo](http://demo.stylesplugin.com/twentythirteen)
40
 
41
+ **Developer Resources**
42
+
43
+ * [Styles on Github](https://github.com/stylesplugin)
44
+ * [Brainstorm Media on Github](https://github.com/brainstormmedia)
45
+ * Code Walkthrough: [How to add support for your own themes](http://www.youtube.com/playlist?list=PLxj61Fojm1RGevBh10U2qCqjwoH4Awo-P)
46
+
47
+ **Contact**
48
+
49
+ * [@stylesplugin](http://twitter.com/stylesplugin) on Twitter
50
+ * [Review this plugin](http://wordpress.org/support/view/plugin-reviews/styles)
51
+ * [Get support](http://wordpress.org/support/plugin/styles)
52
+
53
  == Installation ==
54
 
55
+ 1. Upload the `styles` folder to the `/wp-content/plugins/` directory.
56
+ 1. Activate the plugin through the 'Plugins' menu in WordPress.
57
+ 1. Install and activate your theme's support plugin. If you are running TwentyTen through TwentyThirteen, Styles will prompt you to do this. If you would like to use Styles with other themes, check [stylesplugin.com](http://stylesplugin.com) or [code your own](http://www.youtube.com/playlist?list=PLxj61Fojm1RGevBh10U2qCqjwoH4Awo-P).
58
+ 1. Edit your site under `Appearance > Customize`.
59
 
60
  == Screenshots ==
61
 
76
 
77
  = Does Styles support my theme? =
78
 
79
+ Maybe! We have additional themes available available at [StylesPlugin.com](http://stylesplugin.com). If you don't find your theme there, [watch this walkthrough](http://www.youtube.com/playlist?list=PLxj61Fojm1RGevBh10U2qCqjwoH4Awo-P) for a developer's guide on how to add support. Adding one option takes only one line of code.
80
+
81
+ = I'd like to distribute a theme add-on I created for Styles =
82
+
83
+ If you [watched the walkthrough](http://www.youtube.com/playlist?list=PLxj61Fojm1RGevBh10U2qCqjwoH4Awo-P) and created an add-on for Styles, please share it with others. It's our goal to make the lives of theme developers and end-users much, much easier.
84
+
85
+ If you would like to sell your add-on at [stylesplugin.com](http://stylesplugin.com), get in touch! Email us at `styles (at) stylesplugin.com` or find us on Twitter as [@stylesplugin](http://twitter.com/stylesplugin).
86
 
87
  = Will this plugin slow down my site? =
88
 
90
 
91
  == Changelog ==
92
 
93
+ = 1.0.7 =
94
+
95
+ * Fix: Clearing a setting now updates the preview without a page refresh.
96
+ * Fix: Settings requiring "!important" are fixed and support live preview.
97
+ * Fix: Plugin header settings no longer conflicts with other plugins.
98
+ * Fix: Remove all options when uninstalling on a site network.
99
+ * Change: 'color' label now says 'text color'.
100
+ * New: Contact links and developer resources added to readme
101
+
102
  = 1.0.6 =
103
  * New: Add installation notice to Customizer.
104
 
158
 
159
  == Upgrade Notice ==
160
 
161
+ * Fix: Clearing a setting now updates the preview without a page refresh.
162
+ * Fix: Settings requiring "!important" are fixed and support live preview.
163
+ * Fix: Plugin header settings no longer conflicts with other plugins.
164
+ * Fix: Remove all options when uninstalling on a site network.
165
+ * Change: 'color' label now says 'text color'.
166
+ * New: Contact links and developer resources added to readme
styles.php CHANGED
@@ -2,11 +2,10 @@
2
  /*
3
  Plugin Name: Styles
4
  Plugin URI: http://stylesplugin.com
5
- Description: Change the appearance of your theme using the WordPress admin. Creates WordPress theme options for images, colors, gradients, and fonts.
6
- Version: 1.0.6
7
  Author: Brainstorm Media
8
  Author URI: http://brainstormmedia.com
9
- Git URI: https://updates%40brainstormmedia.com:updates@bitbucket.org/brainstormmedia/styles.git
10
  */
11
 
12
  /**
2
  /*
3
  Plugin Name: Styles
4
  Plugin URI: http://stylesplugin.com
5
+ Description: Change the appearance of your theme using the <a href="customize.php">WordPress Customizer</a>. Styles changes everything.
6
+ Version: 1.0.7
7
  Author: Brainstorm Media
8
  Author URI: http://brainstormmedia.com
 
9
  */
10
 
11
  /**
uninstall.php CHANGED
@@ -11,8 +11,6 @@ if( ! defined ( 'ABSPATH' ) && ! defined ( 'WP_UNINSTALL_PLUGIN' ) )
11
 
12
  global $wpdb;
13
 
14
- $sql = "DELETE from $wpdb->options WHERE option_name LIKE 'storm-styles-%'";
15
-
16
  if( is_multisite() ){
17
 
18
  // Site network: remove options from each blog
@@ -22,6 +20,8 @@ if( is_multisite() ){
22
  foreach( $blog_ids as $id ) {
23
  switch_to_blog( $id );
24
 
 
 
25
  $wpdb->query( $sql );
26
 
27
  restore_current_blog();
@@ -31,5 +31,6 @@ if( is_multisite() ){
31
 
32
  }else {
33
  // Single site
 
34
  $wpdb->query( $sql );
35
  }
11
 
12
  global $wpdb;
13
 
 
 
14
  if( is_multisite() ){
15
 
16
  // Site network: remove options from each blog
20
  foreach( $blog_ids as $id ) {
21
  switch_to_blog( $id );
22
 
23
+ // $wpdb->options is new for each blog, so we're duplicating SQL in the loop
24
+ $sql = "DELETE from $wpdb->options WHERE option_name LIKE 'storm-styles-%'";
25
  $wpdb->query( $sql );
26
 
27
  restore_current_blog();
31
 
32
  }else {
33
  // Single site
34
+ $sql = "DELETE from $wpdb->options WHERE option_name LIKE 'storm-styles-%'";
35
  $wpdb->query( $sql );
36
  }