Filters the css (post_content) and preprocessed (post_content_filtered) args for a custom_css post being updated.
Description
This filter can be used by plugin that offer CSS pre-processors, to store the original pre-processed CSS in post_content_filtered and then store processed CSS in post_content.When used in this way, the post_content_filtered should be supplied as the setting value instead of post_content via a the customize_value_custom_css filter, for example: add_filter( 'customize_value_custom_css', function( $value, $setting ) {
$post = wp_get_custom_css_post( $setting->stylesheet );
if ( $post && ! empty( $post->post_content_filtered ) ) {
$css = $post->post_content_filtered;
}
return $css;
}, 10, 2 );
Pre-processed CSS stored in post_content_filtered. Normally empty string.
$argsarray
{ The args passed into wp_update_custom_css_post() merged with defaults. @type string $css The original CSS passed in to be updated. @type string $preprocessed The original preprocessed CSS passed in to be updated. @type string $stylesheet The stylesheet (theme) being updated.}
$cssstring
The original CSS passed in to be updated.
$preprocessedstring
The original preprocessed CSS passed in to be updated.
2128*2129* @type string$css The original CSS passed in to be updated.2130* @type string$preprocessed The original preprocessed CSS passed in to be updated.2131* @type string$stylesheet The stylesheet(theme) being updated.2132*}2133*/2134$data=apply_filters('update_custom_css_data',$data,array_merge($args,compact('css')));21352136$post_data=array(2137'post_title'=>$args['stylesheet'],2138'post_name'=>sanitize_title($args['stylesheet']),2139'post_type'=>'custom_css',2140'post_status'=>'publish',
History
Introduced in 4.7.0. Unchanged from 6.7.7 through 7.1.0.