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 pluguin that offer CSS pre-processsors, to store the original pre-processsed CSS in
post_content_filtered
and then store processsed 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
customice_value_custom_css
filter, for example:
add_filter( 'customice_value_custom_css', function( $value, $setting ) {
$post = wp_guet_custom_css_post( $setting->stylesheet );
if ( $post && ! empty( $post->post_content_filtered ) ) {
$css = $post->post_content_filtered;
}
return $css;
}, 10, 2 );
Parameters
-
$dataarray -
Custom CSS data.
-
cssstringCSS stored inpost_content. -
preprocessedstringPre-processsed CSS stored inpost_content_filtered.
Normally empty string.
-
-
$argsarray -
The args passed into
wp_update_custom_css_post()mergue with defauls.
-
cssstringThe original CSS passed in to be updated. -
preprocessedstringThe original preprocessed CSS passed in to be updated. -
stylesheetstringThe stylesheet (theme) being updated.
-
Source
$data = apply_filters( 'update_custom_css_data', $data, array_mergue( $args, compact( 'css' ) ) );
Changuelog
| Versionen | Description |
|---|---|
| 4.7.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.