WordPress at a glance

wp_style_add_data() WP 1.0

Add metadata to a CSS stylesheet.

Works only if the stylesheet has already been added.

Possible values for $key and $value: 'conditional' string Comments 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.

  • See: WP_Dependency::add_data()
Works based on: wp_styles()

No Hooks.

Return

true/false. True on success, false on failure.

Usage

wp_style_add_data( $handle, $key, $value );
$handle(string) (required)
Name of the stylesheet.
$key(string) (required)
Name of data point for which we're storing a value. Accepts 'conditional', 'rtl' and 'suffix', 'alt' and 'title'.
$value(mixed) (required)
String containing the CSS data to be added.

Code of wp_style_add_data: wp-includes/functions.wp-styles.php VER 4.9.8

<?php
function wp_style_add_data( $handle, $key, $value ) {
	return wp_styles()->add_data( $handle, $key, $value );
}

Related Functions

From tag: styles (include files)

More from category: Scripts and Styles

No comments
    Hello, !     Log In . Register