wp_style_is()
wp_style_is( string $handle, string $list = ‘enqueued’ …
wp_style_is( string $handle, string $list = ‘enqueued’ )
检查是否已将CSS样式表添加到队列中。
Check whether a CSS stylesheet has been added to the queue.
目录锚点:#参数#源码#笔记
参数(Parameters)
| 参数 | 类型 | 说明 |
|---|---|---|
| $handle | (string) | 样式表的名称。 |
| $list | (string) | 要检查的样式表的状态。接受’enqueued’、’registered’、’queue’、’tou-do’和’done’。 |
源码(Source)
/**
* Check whether a CSS stylesheet has been added to the queue.
*
* @since 2.8.0
*
* @param string $handle Name of the stylesheet.
* @param string $list Optional. Status of the stylesheet to check. Default 'enqueued'.
* Accepts 'enqueued', 'registered', 'queue', 'to_do', and 'done'.
* @return bool Whether style is queued.
*/
function wp_style_is( $handle, $list = 'enqueued' ) {
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );
return (bool) wp_styles()->query( $handle, $list );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 2.8.0 | wp-includes/functions.wp-styles.php | 4 | 20 |
笔记(Notes)
在WordPress的旧版本中(在3.1中选中),不接受$list param的“enqueued”值,并在启用strict模式时导致PHP通知和警告。
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。





还没有任何评论,赶紧来占个楼吧!