wp_get_custom_css
Filters the custom CSS output into the head element.
Usage
add_filter( 'wp_get_custom_css', 'wp_kama_get_custom_css_filter', 10, 2 ); /** * Function for `wp_get_custom_css` filter-hook. * * @param string $css CSS pulled in from the Custom CSS post type. * @param string $stylesheet The theme stylesheet name. * * @return string */ function wp_kama_get_custom_css_filter( $css, $stylesheet ){ // filter... return $css; }
- $css(string)
- CSS pulled in from the Custom CSS post type.
- $stylesheet(string)
- The theme stylesheet name.
Changelog
Since 4.7.0 | Introduced. |
Where the hook is called
wp_get_custom_css
wp-includes/theme.php 2050
$css = apply_filters( 'wp_get_custom_css', $css, $stylesheet );
Where the hook is used in WordPress
wp-includes/customize/class-wp-customize-custom-css-setting.php 88
add_filter( 'wp_get_custom_css', array( $this, 'filter_previewed_wp_get_custom_css' ), 9, 2 );
wp-includes/default-filters.php 244
add_filter( 'wp_get_custom_css', 'wp_replace_insecure_home_url' );