WordPress at Your Fingertips
function is not described

WP_Styles::print_inline_style() public WP 3.3.0

Prints extra CSS styles of a registered stylesheet.

{} It's a method of the class: WP_Styles{}

No Hooks.


String|true|false. False if no data exists, inline styles if $echo is true, true otherwise.


global $wp_styles;
$wp_styles->print_inline_style( $handle, $echo );
$handle(string) (required)
The style's registered handle.
Whether to echo the inline style instead of just returning it.
Default: true


Since 3.3.0 Introduced.

Code of WP_Styles::print_inline_style() WP 5.7.2

public function print_inline_style( $handle, $echo = true ) {
	$output = $this->get_data( $handle, 'after' );

	if ( empty( $output ) ) {
		return false;

	$output = implode( "\n", $output );

	if ( ! $echo ) {
		return $output;

		"<style id='%s-inline-css'%s>\n%s\n</style>\n",
		esc_attr( $handle ),

	return true;