Skip to content

Commit

Permalink
fix (optimized inline css): if styles have dynamic content, the style…
Browse files Browse the repository at this point in the history
…s will be printed double
  • Loading branch information
Benjamin Intal authored and Benjamin Intal committed Nov 1, 2023
1 parent 4f210ab commit 14c1735
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/css-optimize.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ public static function parse_block_style( $block, &$style_arr ) {

$all_block_styles = array();
foreach ( $styles[0] as $i => $style_tag ) {
// If the styles contain dynamic content, let's not include
// it in the optimized styles it because we need it dynamic.
if ( stripos( $styles[1][ $i ], '!#stk_dynamic' ) ) {
return;
}

// Add the styles to our list of styles to optimize.
$all_block_styles[] = array(
$styles[0][ $i ],
Expand Down

0 comments on commit 14c1735

Please sign in to comment.