添加元数据到样式表:wp_style_add_data()
wp_style_add_data() 是一个非常棒的函数,它可以让你添加元数据到你的样式中,包括条件注释、RTL的支持和更多!
来看看吧:
function twentynineteen_scripts() {
wp_style_add_data( ‘twentynineteen-style’, ‘rtl’, ‘replace’ );
}
add_action( ‘wp_enqueue_scripts’, ‘twentynineteen_scripts’ );
twentynineteen-style:Name of the stylesheet.
rtl:Name of data point for which we’re storing a value. Accepts ‘conditional’, ‘rtl’ and ‘suffix’, ‘alt’ and ‘title’.
replace:String containing the CSS data to be added.
————————————————
版权声明:本文为CSDN博主「赵蔚冬」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/u012809520/article/details/89346208