WP_Customize_Custom_CSS_Setting::filter_previewed_wp_get_custom_css()
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
- See: wp_get_custom_css()
Changelog
Since 4.7.0 | Introduced. |
WP_Customize_Custom_CSS_Setting::filter_previewed_wp_get_custom_css() WP Customize Custom CSS Setting::filter previewed wp get custom css code WP 6.6.1
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; }