From eeb71b5499a70d4ec13720e6edaee3ef00a88f57 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 2 Jan 2012 22:32:00 +0000 Subject: [PATCH] Trigger the wp_print_syles action from wp_print_styles() only when handles are not passed. Prevents front-end styles from leaking into the admin. Props nacin. see #19510 for trunk git-svn-id: http://svn.automattic.com/wordpress/trunk@19649 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.wp-styles.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/functions.wp-styles.php b/wp-includes/functions.wp-styles.php index 8a887e8e0..db8b583e9 100644 --- a/wp-includes/functions.wp-styles.php +++ b/wp-includes/functions.wp-styles.php @@ -18,10 +18,12 @@ * @return bool True on success, false on failure. */ function wp_print_styles( $handles = false ) { - do_action( 'wp_print_styles' ); if ( '' === $handles ) // for wp_head $handles = false; + if ( ! $handles ) + do_action( 'wp_print_styles' ); + global $wp_styles; if ( ! is_a( $wp_styles, 'WP_Styles' ) ) { if ( ! did_action( 'init' ) )