| @@ 235-268 (lines=34) @@ | ||
| 232 | $warnings[] = 'kses found stuff'; |
|
| 233 | ||
| 234 | // if we're not using a preprocessor |
|
| 235 | if ( ! $args['preprocessor'] ) { |
|
| 236 | ||
| 237 | /** |
|
| 238 | * Fires before parsing the css with CSSTidy, but only if |
|
| 239 | * the preprocessor is not configured for use. |
|
| 240 | * |
|
| 241 | * @module custom-css |
|
| 242 | * |
|
| 243 | * @since 1.7.0 |
|
| 244 | * |
|
| 245 | * @param obj $csstidy The csstidy object. |
|
| 246 | * @param string $css Custom CSS. |
|
| 247 | * @param array $args Array of custom CSS arguments. |
|
| 248 | */ |
|
| 249 | do_action( 'safecss_parse_pre', $csstidy, $css, $args ); |
|
| 250 | ||
| 251 | $csstidy->parse( $css ); |
|
| 252 | ||
| 253 | /** |
|
| 254 | * Fires after parsing the css with CSSTidy, but only if |
|
| 255 | * the preprocessor is not cinfigured for use. |
|
| 256 | * |
|
| 257 | * @module custom-css |
|
| 258 | * |
|
| 259 | * @since 1.7.0 |
|
| 260 | * |
|
| 261 | * @param obj $csstidy The csstidy object. |
|
| 262 | * @param array $warnings Array of warnings. |
|
| 263 | * @param array $args Array of custom CSS arguments. |
|
| 264 | */ |
|
| 265 | do_action( 'safecss_parse_post', $csstidy, $warnings, $args ); |
|
| 266 | ||
| 267 | $css = $csstidy->print->plain(); |
|
| 268 | } |
|
| 269 | ||
| 270 | if ( $args['add_to_existing'] ) |
|
| 271 | $add_to_existing = 'yes'; |
|
| @@ 535-568 (lines=34) @@ | ||
| 532 | } |
|
| 533 | ||
| 534 | // if we're not using a preprocessor. |
|
| 535 | if ( ! $args['preprocessor'] ) { |
|
| 536 | ||
| 537 | /** This action is documented in modules/custom-css/custom-css.php */ |
|
| 538 | do_action( 'safecss_parse_pre', $csstidy, $css, $args ); |
|
| 539 | ||
| 540 | $csstidy->parse( $css ); |
|
| 541 | ||
| 542 | /** This action is documented in modules/custom-css/custom-css.php */ |
|
| 543 | do_action( 'safecss_parse_post', $csstidy, $warnings, $args ); |
|
| 544 | ||
| 545 | $css = $csstidy->print->plain(); |
|
| 546 | } |
|
| 547 | } |
|
| 548 | return $css; |
|
| 549 | } |
|
| 550 | ||
| 551 | /** |
|
| 552 | * Override $content_width in customizer previews. |
|
| 553 | */ |
|
| 554 | public static function preview_content_width() { |
|
| 555 | global $wp_customize; |
|
| 556 | if ( ! is_customize_preview() ) { |
|
| 557 | return; |
|
| 558 | } |
|
| 559 | ||
| 560 | $setting = $wp_customize->get_setting( 'jetpack_custom_css[content_width]' ); |
|
| 561 | if ( ! $setting ) { |
|
| 562 | return; |
|
| 563 | } |
|
| 564 | ||
| 565 | $customized_content_width = (int) $setting->post_value(); |
|
| 566 | if ( ! empty( $customized_content_width ) ) { |
|
| 567 | $GLOBALS['content_width'] = $customized_content_width; |
|
| 568 | } |
|
| 569 | } |
|
| 570 | ||
| 571 | /** |
|