wp_print_styles() WP 2.6.0
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.
Хуки из функции
Возвращает
Строку[]. On success, an array of handles of processed WP_Dependencies items; otherwise, an empty array.
Использование
wp_print_styles( $handles );
- $handles(строка/true/false/массив)
- Styles to be printed.
По умолчанию: 'false'
Заметки
- Global. WP_Styles. $wp_styles The WP_Styles object for printing styles.
Список изменений
С версии 2.6.0 | Введена. |
Код wp_print_styles() wp print styles WP 5.6.2
function wp_print_styles( $handles = false ) {
global $wp_styles;
if ( '' === $handles ) { // For 'wp_head'.
$handles = false;
}
if ( ! $handles ) {
/**
* Fires before styles in the $handles queue are printed.
*
* @since 2.6.0
*/
do_action( 'wp_print_styles' );
}
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
if ( ! ( $wp_styles instanceof WP_Styles ) ) {
if ( ! $handles ) {
return array(); // No need to instantiate if nothing is there.
}
}
return wp_styles()->do_items( $handles );
}