Skip to content

Commit 32f4b00

Browse files
committed
Improved documentation
1 parent 61d0e5e commit 32f4b00

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

functions.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ function wp_dynamic_css_set_callback( $handle, $callback )
5858
/**
5959
* Clear the cached compiled CSS for the given handle.
6060
*
61-
* Initially, registered dynamic stylesheets are compiled and stored in cache.
62-
* Subsequesnt requests are served statically from cache until
63-
* wp_dynamic_css_clear_cache() is called and clears it, forcing the compiler
64-
* to recompile the CSS.
61+
* Registered dynamic stylesheets that have the $cache flag set to true are
62+
* compiled only once and then stored in cache. Subsequesnt requests are
63+
* served statically from cache until wp_dynamic_css_clear_cache() is called
64+
* and clears it, forcing the compiler to recompile the CSS.
6565
*
6666
* @param string $handle The name of the stylesheet to be cleared from cache
6767
*/

readme.txt

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Contributors: Askupa Software, ykadosh
33
Tags: dynamic css, css, customizer, get_theme_mod, css variables, css compiler
44
Requires at least: 3.0
5-
Tested up to: 4.5.1
6-
Stable tag: 1.0.4
5+
Tested up to: 4.5.3
6+
Stable tag: 1.0.5
77
License: GPLv3 or later
88
License URI: http://www.gnu.org/licenses/gpl-3.0.html
99

@@ -31,7 +31,7 @@ wp_dynamic_css_enqueue( 'my_dynamic_style', 'path/to/my-style.css' );
3131
// 3. Set the callback function (used to convert variables to actual values)
3232
function my_dynamic_css_callback( $var_name )
3333
{
34-
return get_theme_mod($var_name);
34+
return get_theme_mod($var_name);
3535
}
3636
wp_dynamic_css_set_callback( 'my_dynamic_style', 'my_dynamic_css_callback' );
3737

@@ -42,7 +42,7 @@ Then, create a file called `my-style.css` and write this in it:
4242

4343
<pre>
4444
body {
45-
background-color: $body_bg_color;
45+
background-color: $body_bg_color;
4646
}
4747
</pre>
4848

@@ -52,7 +52,16 @@ Now, let's say that <code>get_theme_mod('body_bg_color')</code> returns the valu
5252

5353
<pre>
5454
body {
55-
background-color: #fff;
55+
background-color: #fff;
56+
}
57+
</pre>
58+
59+
There's even support for array subscripts and piped filters:
60+
61+
<pre>
62+
body {
63+
background-color: $myVar['index'];
64+
color: $myVar|myFilter;
5665
}
5766
</pre>
5867

@@ -70,6 +79,12 @@ Please follow the instructions on the plugin's [GitHub page](https://github.com/
7079

7180
== Changelog ==
7281

82+
= 1.0.5 =
83+
* (NEW) Added support for cache
84+
* (NEW) Added support for piped filters
85+
* (FIX) Separated enqueued stylesheets
86+
* (FIX) Increased priority of enqueued stylesheets to override static stylesheets
87+
7388
= 1.0.4 =
7489
* (FIX) Set cache-control to no-cache so that changes to options are reflected immediately
7590
* (NEW) Added support for CSS minification

0 commit comments

Comments
 (0)