WP_Customize_Custom_CSS_Setting::filter_previewed_wp_get_custom_css()publicWP 4.7.0

Filters wp_get_custom_css applying the customized value.

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

Method of the class: WP_Customize_Custom_CSS_Setting{}

No Hooks.

Return

String. CSS.

Usage

$WP_Customize_Custom_CSS_Setting = new WP_Customize_Custom_CSS_Setting();
$WP_Customize_Custom_CSS_Setting->filter_previewed_wp_get_custom_css( $css, $stylesheet );
$css(string) (required)
Original CSS.
$stylesheet(string) (required)
Current stylesheet.

Notes

Changelog

Since 4.7.0 Introduced.

WP_Customize_Custom_CSS_Setting::filter_previewed_wp_get_custom_css() code WP 6.5.2

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;
}