检查是否已将CSS样式表添加到队列中。
原型
wp_style_is( string $handle, string $list = 'enqueued' )
参数
$handle
(string)
(Required)
样式表的名称。
$list
(string)
(Optional)
要检查的样式表的状态。接受’入队’,‘注册’,‘队列’,‘to_do’和’完成’。
返回值
(bool)
风格是否排队。
源文件
路径:wp-includes/functions.wp-styles.php
<?php
...
function wp_style_is( $handle, $list = 'enqueued' ) {
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
return (bool) wp_styles()->query( $handle, $list );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/wp_style_is/