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

Adds extra CSS styles to a registered stylesheet.

Parameters Parameters


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


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

Top ↑

Return Return

(bool) True on success, false on failure.

Top ↑

More Information More Information

This method adds style rules ($code) to the given stylesheet to be output as embedded style (i.e. in a <style> element).

Top ↑

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

Top ↑

Changelog Changelog

Version Description
3.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

Top ↑

You must log in before being able to contribute a note or feedback.