wp_style_add_data

Add metadata to a CSS stylesheet.

Description

wp_style_add_data( (string) $handle, (string) $key, (mixed) $value ); 

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.

Parameters (3)

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

Usage

  1. if ( !function_exists( 'wp_style_add_data' ) ) { 
  2. require_once ABSPATH . WPINC . '/functions.wp-styles.php'; 
  3.  
  4. // Name of the stylesheet. 
  5. $handle = ''; 
  6.  
  7. // Name of data point for which we're storing a value. 
  8. // Accepts 'conditional', 'rtl' and 'suffix', 'alt' and 'title'. 
  9. $key = ''; 
  10.  
  11. // String containing the CSS data to be added. 
  12. $value = null; 
  13.  
  14. // NOTICE! Understand what this does before running. 
  15. $result = wp_style_add_data($handle, $key, $value); 
  16.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/functions.wp-styles.php  
  1. function wp_style_add_data( $handle, $key, $value ) { 
  2. returnwp_styles)->add_data( $handle, $key, $value );