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

Viper007Bond viper at viper007bond.com
Thu Oct 30 06:47:44 GMT 2008


add_action('wp_head', 'wp_print_styles_check', 10);
function wp_print_styles_check() {
    if ( !did_action( 'wp_print_styles' ))
        wp_print_styles();
}


Although I'd personally do a version check instead of did_action() on the
off-chance that a plugin needed to remove wp_print_styles from the wp_head
hook for some reason.

On Wed, Oct 29, 2008 at 11:24 PM, Krusty Ruffle <
krustyruffle at rustykruffle.com> 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
>



-- 
Viper007Bond | http://www.viper007bond.com/ | http://www.finalgear.com/


More information about the wp-hackers mailing list