Skip to content

Commit 7d254e1

Browse files
authored
Update best-practices-asset-management.md
1 parent 006717d commit 7d254e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/best-practices-asset-management.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# WordPress Asset Management Best Practices
22

3-
WordPress uses internal functions to register (`wp_register_script()` & `wp_register_style()`) and enqueue (`wp_enqueue_script()` & `wp-enqueue_style()` static JavaScript and CSS files so that WordPress Core, Themes and Plugins can **programatically interact with scripts and styles.**
3+
##### WordPress uses internal functions to register (`wp_register_script()` & `wp_register_style()`) and enqueue (`wp_enqueue_script()` & `wp-enqueue_style()` static JavaScript and CSS files so that WordPress Core, Themes and Plugins can **programatically interact with scripts and styles.**
44

55
This approach allows WordPress to:
66
1. Load registered dependencies
@@ -29,7 +29,7 @@ This allows the entire class and application interact programmatically with the
2929
* **Please don't use a postfix like `-js`, `-css`, `-script`, `-style`** -- WordPress will add postfixes when printing assets in the DOM, resulting in `something-js-js`. However, if a product is called purecss or momentjs, we then use the full slug with repetitive postfix, despite repetion (i.e. `purecss-css`)
3030
* **Try to keep parity between filename and dependency string**. This makes life easier and applications scale nicer.
3131
* **Plan for growth: avoid calling dependency "my-product.ext."** Use `-primary`, `-core` or `-main` prefix.
32-
* Never use WordPress Filters or difficult-to-predict dynamic variables to register asset handles so others may dequeue and register handles with confidence.
32+
* **Never use WordPress Filters or difficult-to-predict dynamic variables** so others may dequeue and register handles with confidence.
3333

3434
#### Leverage dependency chaining and the `array()` method for `wp_enqueue_*()`
3535

0 commit comments

Comments
 (0)