Opened 5 years ago
Closed 5 years ago
#7720 closed defect (bug) (fixed)
default-filters.php missing add_action('wp_head', 'wp_print_styles')
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.7 |
| Component: | General | Version: | 2.6.1 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
wp_enqueue_scripts has a corresponding add_action('wp_head', 'wp_print_scripts') so that enqueued scripts are automatically emitted in the document head.
But wp_enqueue_styles are not emitted automatically because a call to add_action('wp_head', 'wp_print_styles') is missing from default-filters.php.
The add_action for styles should be placed above the print scripts (or with a priority of 9) so that css styles are emitted before javascipt as recommended by YSlow.
add_action('wp_head', 'wp_print_styles', 9);
add_action('wp_head', 'wp_print_scripts');
Note the admin screens do hook wp_print_styles and emit styles correctly
add_action('admin_print_scripts', 'wp_print_scripts', 20);
add_action('admin_print_styles', 'wp_print_styles', 20);
Change History (1)
Note: See
TracTickets for help on using
tickets.

(In [8854]) Add wp_print_styles to wp_head. Props rickoman. fixes #7720