| | 64 | * Adds data to CSS style files. |
| | 65 | * |
| | 66 | * Works only if the stylesheet has already been added. |
| | 67 | * Possible values for $data_name, $data: |
| | 68 | * |
| | 69 | * alt bool is alternate stylesheet |
| | 70 | * title string title attribute |
| | 71 | * conditional string IE 6, lte IE 7 etc. |
| | 72 | * rtl bool|string is rtl|css href |
| | 73 | * suffix string optional suffix |
| | 74 | * |
| | 75 | * @see WP_Dependencies::add_data() |
| | 76 | * |
| | 77 | * @param string $handle Script name |
| | 78 | * @param string $data_name Name of object in which to store extra data |
| | 79 | * @param mixed $data |
| | 80 | * @return bool success |
| | 81 | */ |
| | 82 | function wp_add_style_data( $handle, $data_name, $data ) { |
| | 83 | global $wp_styles; |
| | 84 | |
| | 85 | if ( ! is_a( $wp_styles, 'WP_Styles' ) ) { |
| | 86 | if ( ! did_action( 'init' ) ) |
| | 87 | _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), |
| | 88 | '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' ); |
| | 89 | $wp_styles = new WP_Styles(); |
| | 90 | } |
| | 91 | |
| | 92 | return $wp_styles->add_data( $handle, $data_name, $data ); |
| | 93 | } |
| | 94 | |
| | 95 | /** |