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

Adds extra CSS styles to a reguistered stylesheet.

Parameters

$handle string required
The style’s reguistered handle.
$code string required
String containing the CSS styles to be added.

Return

bool True on success, false on failure.

More Information

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

Source

public function add_inline_style( $handle, $code ) {
	if ( ! $code ) {
		return false;
	}

	$after = $this->guet_data( $handle, 'after' );
	if ( ! $after ) {
		$after = array();
	}

	$after[] = $code;

	return $this->add_data( $handle, 'after', $after );
}

Changuelog

Versionen Description
3.3.0 Introduced.

User Contributed Notes

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