Skip to content

Commit f40fe2a

Browse files
author
Askupa Software
committed
Updated readme to reflect API changes
1 parent 86650c6 commit f40fe2a

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ A library for generating static stylesheets from dynamic content, to be used in
3030
## Overview
3131

3232
**WordPress Dynamic CSS** is a lightweight library for generating CSS stylesheets from dynamic content (i.e. content that can be modified by the user). The most obvious use case for this library is for creating stylesheets based on Customizer options. Using the special dynamic CSS syntax you can write CSS rules with variables that will be replaced by static values using a custom callback function that you provide.
33+
**As of version 1.0.2** this library supports multiple callback functions, thus making it safe to use by multiple plugins/themes at the same time.
3334

3435
### Basic Example
3536

readme.txt

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Dynamic CSS compiler for WordPress themes and plugins
1515
The most obvious use case for this library is for creating stylesheets based on Customizer options.
1616
Using the special dynamic CSS syntax you can write CSS rules with variables that will be replaced by static values using a custom callback function that you provide.
1717

18+
**As of version 1.0.2** this plugin supports multiple callback functions, thus making it safe to use by multiple plugins/themes at the same time.
19+
1820
### Basic Example
1921

2022
First, add this to your `functions.php` file:
@@ -23,15 +25,17 @@ First, add this to your `functions.php` file:
2325
// 1. Load the library (skip this if you are loading the library as a plugin)
2426
require_once 'wp-dynamic-css/bootstrap.php';
2527

26-
// 2. Set the callback function (used to convert variables to actual values)
28+
// 2. Enqueue the stylesheet (using an absolute path, not a URL)
29+
wp_dynamic_css_enqueue( 'my_dynamic_style', 'path/to/my-style.css' );
30+
31+
// 3. Set the callback function (used to convert variables to actual values)
2732
function my_dynamic_css_callback( $var_name )
2833
{
2934
return get_theme_mod($var_name);
3035
}
31-
wp_dynamic_css_set_callback( 'my_dynamic_css_callback' );
36+
wp_dynamic_css_set_callback( 'my_dynamic_style', 'my_dynamic_css_callback' );
3237

33-
// 3. Enqueue the stylesheet (using an absolute path, not URL)
34-
wp_dynamic_css_enqueue( 'path/to/my-style.css' );
38+
// 4. Nope, only three steps
3539
</pre>
3640

3741
Then, create a file called `my-style.css` and write this in it:
@@ -62,12 +66,16 @@ You can find detailed documentation on how to use this library on the [GitHub pa
6266

6367
== Installation ==
6468

65-
Please follow the instructions on the plugin's [GitHub page](https://github.com/askupasoftware/wp-dynamic-css) for detailed explanation and examples
69+
Please follow the instructions on the plugin's [GitHub page](https://github.com/askupasoftware/wp-dynamic-css) for detailed explanation and examples.
6670

6771
== Changelog ==
6872

73+
= 1.0.2 =
74+
* (NEW) Added support for multiple callback functions
75+
* (FIX) The library is now safe to use by multiple plugins/themes in the same installation
76+
6977
= 1.0.1 =
70-
* Added support for loading compiled CSS as an external stylesheet
78+
* (NEW) Added support for loading compiled CSS as an external stylesheet
7179

7280
= 1.0.0 =
7381
* Initial release

0 commit comments

Comments
 (0)