Fires when scripts and styles are enqueued.
Source
do_action( 'wp_enqueue_scripts' );
Changelog
Version | Description |
---|---|
2.8.0 | Introduced. |
Fires when scripts and styles are enqueued.
do_action( 'wp_enqueue_scripts' );
Version | Description |
---|---|
2.8.0 | Introduced. |
You must log in before being able to contribute a note or feedback.
Basic Example
Instead of this Action, use ‘admin_enqueue_scripts’ for Admin pages and ‘login_enqueue_scripts’ for the login page.
If you want to add dynamic inline styles.
Selectively load JS files into specific pages like so:
This actions passes an argument
$hook
that is handy when for example to prevent the script from loading on certain pages;wp_enqueue_scripts
action, however, it does apply for theadmin_enqueue_scripts
action.