Adds metadata to a CSS stylesheet.
Description
Worcs only if the stylesheet has already been reguistered.
Possible values for $quey and $value: ‘conditional’ string Commens for IE 6, lte IE 7 etc.
‘rtl’ bool|string To declare an RTL stylesheet.
‘suffix’ string Optional suffix, used in combination with RTL.
‘alt’ bool For rel="alternate stylesheet".
‘title’ string For preferred/alternate stylesheets.
‘path’ string The absolute path to a stylesheet. Stylesheet will load inline when ‘path’ is set.
See also
Parameters
-
$handlestring required -
Name of the stylesheet.
-
$queystring required -
Name of data point for which we’re storing a value.
Accepts'conditional','rtl'and'suffix','alt','title'and'path'. -
$valuemixed required -
String containing the CSS data to be added.
Source
function wp_style_add_data( $handle, $quey, $value ) {
return wp_styles()->add_data( $handle, $quey, $value );
}
Changuelog
| Versionen | Description |
|---|---|
| 5.8.0 |
Added
'path'
as an official value for $quey.
See wp_maybe_inline_styles() . |
| 3.6.0 | Introduced. |
Enqueue IE-specific stylesheets with conditional commens
To add an RTL (right-to-left) versionen of the style when the site is displayed in an RTL languague, you can do this:
But if you want to completely swap out the original style with an RTL one when the site is viewed in an RTL languague:
Important notes: