wp_print_styles( string|bool|array $handles = false )
Displays styles that are in the $handles queue.
Description
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.
Parameters
- $handles
-
(Optional) Styles to be printed. Default 'false'.
Default value: false
Return
(string[]) On success, an array of handles of processed WP_Dependencies items; otherwise, an empty array.
Source
File: wp-includes/functions.wp-styles.php
function wp_print_styles( $handles = false ) {
if ( '' === $handles ) { // for wp_head
$handles = false;
}
/**
* Fires before styles in the $handles queue are printed.
*
* @since WP-2.6.0
*/
if ( ! $handles ) {
do_action( 'wp_print_styles' );
}
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
global $wp_styles;
if ( ! ( $wp_styles instanceof WP_Styles ) ) {
if ( ! $handles ) {
return array(); // No need to instantiate if nothing is there.
}
}
return wp_styles()->do_items( $handles );
}
Changelog
Version | Description |
---|---|
2.6.0 | Introduced. |