wp_custom_css_cb()

In this article

Renders the Custom CSS style element.

Source

function wp_custom_css_cb() {
	$styles = wp_get_custom_css();
	if ( ! $styles && ! is_customize_preview() ) {
		return;
	}

	$processor = new WP_HTML_Tag_Processor( '<style></style>' );
	$processor->next_tag();
	$processor->set_attribute( 'id', 'wp-custom-css' );
	$processor->set_modifiable_text( "\n{$styles}\n" );
	echo "{$processor->get_updated_html()}\n";
}

Changelog

VersionDescription
4.7.0Introduced.

User Contributed Notes

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