W3cubDocs

/WordPress

WP_Styles::add_inline_style( string $handle, string $code )

Adds extra CSS styles to a registered stylesheet.

Parameters

$handle

(string) (Required) The style's registered handle.

$code

(string) (Required) String containing the CSS styles to be added.

Return

(bool) True on success, false on failure.

Source

File: wp-includes/class.wp-styles.php

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 );
	}

Changelog

Version Description
3.3.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/WP_Styles/add_inline_style