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.

Метод класса: WP_Customize_Custom_CSS_Setting{}

Хуков нет.

Возвращает

Строку. CSS.

Использование

$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(строка) (обязательный)
Original CSS.
$stylesheet(строка) (обязательный)
Current stylesheet.

Заметки

Список изменений

С версии 4.7.0 Введена.

Код WP_Customize_Custom_CSS_Setting::filter_previewed_wp_get_custom_css() WP 6.4.3

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