A WordPress-centric search engine for devs and theme authors



wp_print_styles ›

Since2.6.0
Deprecatedn/a
wp_print_styles ( $handles = false )
Parameters:
  • (string|bool|array) $handles Styles to be printed. Default 'false'.
    Required: No
    Default: false
Returns:
  • (array) On success, a processed array of WP_Dependencies items; otherwise, an empty array.
Defined at:
Codex:

Display styles that are in the $handles queue.

Passing an empty array to $handles prints the queue, passing an array with one string prints that style, and passing an array of strings prints those styles.



Source

function wp_print_styles( $handles = false ) {
	if ( '' === $handles ) // for wp_head
		$handles = false;
	/**
	 * Fires before styles in the $handles queue are printed.
	 *
	 * @since 2.6.0
	 */
	if ( ! $handles )
		do_action( 'wp_print_styles' );

	global $wp_styles;
	if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
		if ( ! did_action( 'init' ) )
			_doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
				'<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );

		if ( !$handles )
			return array(); // No need to instantiate if nothing is there.
		else
			$wp_styles = new WP_Styles();
	}

	return $wp_styles->do_items( $handles );
}