添加元数据到样式表: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.