Works only if the stylesheet has already been registered. Possible values for $key and $value: '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.
Parameters
$handlestring
Name of the stylesheet.
$keystring
Name of data point for which we're storing a value. Accepts 'rtl' and 'suffix', 'alt', 'title' and 'path'.
$valuemixed
String containing the CSS data to be added.
Return
bool
True on success, false on failure.
Uses · 2
wp_styles()Initializes $wp_styles if it has not been set.
wp_styles()::add_data()
Used by · 8
register_block_style_handle()Finds a style handle for the block metadata field. It detects when a path to file was provided and registers the style under automatically generated handle name. It returns unprocessed style handle otherwise.
Signature, return type and hooks compared across 5 parsed releases.
6.9.0
'conditional' value changed. If the 'conditional' parameter is present the stylesheet will be ignored.from the docblock
5.8.0
Added 'path' as an official value for $key. See wp_maybe_inline_styles().from the docblock
3.6.0
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 6.9.7 tag, from src/wp-includes/functions.wp-styles.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.