[wp-hackers] requesting information about wp_*_style functions

Callum Macdonald lists.automattic.com at callum-macdonald.com
Thu Oct 30 06:47:20 GMT 2008


G'day,

Calling wp_print_styles() multiple times won't print the styles multiple
times, so it's not too much of a concern.

I wonder what will yield better performance, double calling it, or
calling the did_action() function. Personally, I'd probably double call
and then discard it once we go to 2.7, but then I'm not big on backwards
compatibility. :)

Cheers - Callum.

On Thu, 2008-10-30 at 02:24 -0400, Krusty Ruffle wrote:
> Ahh... So the conditional would probably be a good idea then. If I'm
> thinking strait then this:
> 
>         if ( !did_action( 'wp_print_styles' ))
>             add_action( 'wp_head', 'wp_print_styles', '100');
> 
> would cause my code to only add the action if wp_print_styles has not
> already been called... Or would it be better to use a version check and hook
> into wp_print_styles?
> 
> On Thu, Oct 30, 2008 at 1:42 AM, DD32 <wordpress at dd32.id.au> wrote:
> 
> > Just a FYI:
> > As of WordPress 2.7, The Print styles hook is included in core for
> > front-end requests too:
> >
> > http://trac.wordpress.org/browser/trunk/wp-includes/default-filters.php#L165
> >
> 
> <snip>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list