wp_print_styles()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
wp_print_styles( string|false|string[] $handles = false ): string[]
Описание
Передача пустого массива в $handles выводит очередь, передача массива с одной строкой выводит этот стиль, а передача массива строк выводит эти стили.
Оригинал (английский)
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.
Параметры
$handles
string|false|string[]
необязательный
= false
Возвращаемое значение
string[]
Исходный код
wp-includes/functions-wp-styles.php:44
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 );
}
История изменений
| Версия | Описание |
|---|---|
| 2.6.0 | Introduced. |

