将元数据添加到CSS样式表。
原型
wp_style_add_data( string $handle, string $key, mixed $value )
描述
仅在已添加样式表时才起作用。
参考:
- WP_Dependency::add_data()
参数
$handle
(string)
(Required)
样式表的名称。
$key
(string)
(Required)
我们存储值的数据点的名称。接受’条件’,‘rtl’和’后缀’,‘alt’和’title’。
$value
(mixed)
(Required)
包含要添加的CSS数据的字符串。
返回值
(bool)
成功时是真的,失败时是假的。
源文件
路径:wp-includes/functions.wp-styles.php
<?php
...
function wp_style_add_data( $handle, $key, $value ) {
return wp_styles()->add_data( $handle, $key, $value );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/wp_style_add_data/