| @@ 553-586 (lines=34) @@ | ||
| 550 | } |
|
| 551 | ||
| 552 | // if we're not using a preprocessor. |
|
| 553 | if ( ! $args['preprocessor'] ) { |
|
| 554 | ||
| 555 | /** This action is documented in modules/custom-css/custom-css.php */ |
|
| 556 | do_action( 'safecss_parse_pre', $csstidy, $css, $args ); |
|
| 557 | ||
| 558 | $csstidy->parse( $css ); |
|
| 559 | ||
| 560 | /** This action is documented in modules/custom-css/custom-css.php */ |
|
| 561 | do_action( 'safecss_parse_post', $csstidy, $warnings, $args ); |
|
| 562 | ||
| 563 | $css = $csstidy->print->plain(); |
|
| 564 | } |
|
| 565 | } |
|
| 566 | return $css; |
|
| 567 | } |
|
| 568 | ||
| 569 | /** |
|
| 570 | * Override $content_width in customizer previews. |
|
| 571 | */ |
|
| 572 | public static function preview_content_width() { |
|
| 573 | global $wp_customize; |
|
| 574 | if ( ! is_customize_preview() ) { |
|
| 575 | return; |
|
| 576 | } |
|
| 577 | ||
| 578 | $setting = $wp_customize->get_setting( 'jetpack_custom_css[content_width]' ); |
|
| 579 | if ( ! $setting ) { |
|
| 580 | return; |
|
| 581 | } |
|
| 582 | ||
| 583 | $customized_content_width = (int) $setting->post_value(); |
|
| 584 | if ( ! empty( $customized_content_width ) ) { |
|
| 585 | $GLOBALS['content_width'] = $customized_content_width; |
|
| 586 | } |
|
| 587 | } |
|
| 588 | ||
| 589 | /** |
|
| @@ 247-280 (lines=34) @@ | ||
| 244 | $warnings[] = 'kses found stuff'; |
|
| 245 | ||
| 246 | // if we're not using a preprocessor |
|
| 247 | if ( ! $args['preprocessor'] ) { |
|
| 248 | ||
| 249 | /** |
|
| 250 | * Fires before parsing the css with CSSTidy, but only if |
|
| 251 | * the preprocessor is not configured for use. |
|
| 252 | * |
|
| 253 | * @module custom-css |
|
| 254 | * |
|
| 255 | * @since 1.7.0 |
|
| 256 | * |
|
| 257 | * @param obj $csstidy The csstidy object. |
|
| 258 | * @param string $css Custom CSS. |
|
| 259 | * @param array $args Array of custom CSS arguments. |
|
| 260 | */ |
|
| 261 | do_action( 'safecss_parse_pre', $csstidy, $css, $args ); |
|
| 262 | ||
| 263 | $csstidy->parse( $css ); |
|
| 264 | ||
| 265 | /** |
|
| 266 | * Fires after parsing the css with CSSTidy, but only if |
|
| 267 | * the preprocessor is not cinfigured for use. |
|
| 268 | * |
|
| 269 | * @module custom-css |
|
| 270 | * |
|
| 271 | * @since 1.7.0 |
|
| 272 | * |
|
| 273 | * @param obj $csstidy The csstidy object. |
|
| 274 | * @param array $warnings Array of warnings. |
|
| 275 | * @param array $args Array of custom CSS arguments. |
|
| 276 | */ |
|
| 277 | do_action( 'safecss_parse_post', $csstidy, $warnings, $args ); |
|
| 278 | ||
| 279 | $css = $csstidy->print->plain(); |
|
| 280 | } |
|
| 281 | ||
| 282 | if ( $args['add_to_existing'] ) |
|
| 283 | $add_to_existing = 'yes'; |
|