You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Readme.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,13 @@ wp_enqueue_less provides a function to enqueue less stylesheets in WordPress.
6
6
7
7
### Composer
8
8
9
-
Composer is the best way to install wp_enqueue_less so you get updates in the future easily.
9
+
Composer is the best way to install wp_enqueue_less, so you get updates in the future easily.
10
10
11
11
```
12
12
composer require ed-itsolutions/wp_enqueue_less
13
13
```
14
14
15
-
and then in your `functions.php`of`plugin.php`
15
+
and then in your `functions.php`or`plugin.php`
16
16
17
17
```php
18
18
require_once('vendor/autoload.php');
@@ -29,7 +29,7 @@ In your normal `wp_enqueue_scripts` action simply call `wp_enqueue_less`
29
29
`wp_enqueue_less` takes 3 arguments.
30
30
31
31
-_key_ - The key name to use for this stylesheet.
32
-
-_filePath_ - The ondisk path to the .less file.
32
+
-_filePath_ - The on-disk path to the .less file.
33
33
-_variables_ - A key->value array of variables to be passed to the less compiler.
34
34
35
35
```php
@@ -49,4 +49,12 @@ wp_enqueue_less will:
49
49
- Compile this less file and write the output to `/wp-content/uploads/less/key-hash.css` (this can be changed with the filter `wp_enqueue_less_css_dir`).
50
50
- Record the current hashes of all the less files used and the variables into the database.
51
51
- On the next call if none of the hashes have changed it will skip parsing.
52
-
- On a daily basis it will clean out its directory of everything but the current hash version of the stylesheet.
52
+
- On a daily basis it will clean out its directory of everything but the current hash version of the stylesheet.
53
+
54
+
### Filters
55
+
56
+
|Filter|Default|Purpose|
57
+
|:-----|:------|:------|
58
+
|wp_enqueue_less_css_url|`wp_upload_dir()['baseurl'] . '/less'`|The URL of the directory the compiled css is served from.|
59
+
|wp_enqueue_less_css_dir|`wp_upload_dir()['basedir'] . '/less'`|The on-disk directory to serve compiled css from.|
60
+
|wp_enqueue_less_compress|`true`|Should wp_enqueue_less compress the outputted css|
0 commit comments