Adds extra CSS styles to a registered stylesheet.
$handlestringrequired
$codestringrequired
This method adds style rules ($code) to the given stylesheet to be output as embedded style (i.e. in a <style> element).
public function add_inline_style( $handle, $code ) {
if ( ! $code ) {
return false;
}
$after = $this->get_data( $handle, 'after' );
if ( ! $after ) {
$after = array();
}
$after[] = $code;
return $this->add_data( $handle, 'after', $after );
}
| Version | Description |
|---|---|
| 3.3.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/WP_Styles/add_inline_style