Everywhere is said that you need to use wp_enqueue_scripts()
instead of wp_print_styles()
.
wp_print_styles()
is located in wp-includes/functions.wp-styles.php
.
So what does it mean? What should I change? Where? Why? Can it compromise my theme?
In short, as of WordPress 3.3 use wp_enqueue_scripts
to load JS and CSS. wp_print_styles
has/had some minor bugs with it (namely, it may include your scripts in the admin as well) – here and here are some more details on all of that. It doesn’t sound like there’s any major security flaws or theme breaking here, just better practice to use wp_enqueue_scripts
.
Additionally:
- wp_enqueue_scripts – for enqueuing on the front end
- login_enqueue_scripts – for enqueuing on the login page
- admin_enqueue_scripts – for enqueuing on admin pages