[wp-trac] [WordPress Trac] #7720: default-filters.php missing
add_action('wp_head', 'wp_print_styles')
WordPress Trac
wp-trac at lists.automattic.com
Tue Sep 9 17:05:05 GMT 2008
#7720: default-filters.php missing add_action('wp_head', 'wp_print_styles')
----------------------+-----------------------------------------------------
Reporter: rickoman | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.7
Component: General | Version: 2.6.1
Severity: normal | Keywords:
----------------------+-----------------------------------------------------
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);
}}}
--
Ticket URL: <http://trac.wordpress.org/ticket/7720>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list