WP_Customize_Custom_CSS_Setting::filter_previewed_wp_get_custom_css( string $css, string $stylesheet ): string

Filters wp_get_custom_css for applying the customized value.

Description

This is used in the preview when wp_get_custom_css() is called for rendering the styles.

See also

Parameters

$cssstringrequired
Original CSS.
$stylesheetstringrequired
Current stylesheet.

Return

string CSS.

Source

public function filter_previewed_wp_get_custom_css( $css, $stylesheet ) {
	if ( $stylesheet === $this->stylesheet ) {
		$customized_value = $this->post_value( null );
		if ( ! is_null( $customized_value ) ) {
			$css = $customized_value;
		}
	}
	return $css;
}

Changelog

VersionDescription
4.7.0Introduced.

User Contributed Notes

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