Skip to content

Commit

Permalink
Fix deprecated error in PHP 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Mar 7, 2024
1 parent 8c2002f commit 90c2f34
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions inc/class-enqueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private function get_inline_css() {
// Generate highlighter style
for ( $i = 0; $i <= 3; $i++ ) {
if ( get_option( 'rtex_highlighter_active_' . $i, true ) ) {
$css_selector = ".rtex-highlighter-${i}, #rtex-highlighter-preview-${i}";
$css_selector = ".rtex-highlighter-{$i}, #rtex-highlighter-preview-{$i}";
$thickness = get_option( 'rtex_highlighter_thickness_' . $i, Config::$highlighter[ $i ]['thickness'] );
$color_hex = get_option( 'rtex_highlighter_color_' . $i, Config::$highlighter[ $i ]['color'] );
$type = get_option( 'rtex_highlighter_type_' . $i, Config::$highlighter[ $i ]['type'] );
Expand All @@ -107,7 +107,7 @@ private function get_inline_css() {
$r = hexdec( substr( $color_hex, 1, 2 ) );
$g = hexdec( substr( $color_hex, 3, 2 ) );
$b = hexdec( substr( $color_hex, 5, 2 ) );
$color = "rgba(${r}, ${g}, ${b}, ${opacity})";
$color = "rgba({$r}, {$g}, {$b}, {$opacity})";
}
}

Expand All @@ -117,12 +117,12 @@ private function get_inline_css() {
if ( 0 === $thickness ) {
$background_value = $color;
} else {
$background_value = "linear-gradient(transparent ${thickness}%, ${color} ${thickness}%)";
$background_value = "linear-gradient(transparent {$thickness}%, {$color} {$thickness}%)";
}
} elseif ( 'stripe' === $type ) {
$background_value = "repeating-linear-gradient(-45deg, ${color} 0, ${color} 3px, transparent 3px, transparent 6px) no-repeat bottom/100% ${thickness}%";
$background_value = "repeating-linear-gradient(-45deg, {$color} 0, {$color} 3px, transparent 3px, transparent 6px) no-repeat bottom/100% {$thickness}%";
} elseif ( 'stripe-thin' === $type ) {
$background_value = "repeating-linear-gradient(-45deg, ${color} 0, ${color} 2px, transparent 2px, transparent 4px) no-repeat bottom/100% ${thickness}%";
$background_value = "repeating-linear-gradient(-45deg, {$color} 0, {$color} 2px, transparent 2px, transparent 4px) no-repeat bottom/100% {$thickness}%";
}

// Generate CSS
Expand All @@ -134,7 +134,7 @@ private function get_inline_css() {
for ( $i = 0; $i <= 3; $i++ ) {
if ( get_option( 'rtex_font_size_active_' . $i, true ) ) {
$font_size = get_option( 'rtex_font_size_size_' . $i, Config::$font_size[ $i ] ) / 100;
$css .= ".rtex-font-size-${i}, #rtex-font-size-preview-${i}{ font-size: ${font_size}em;}";
$css .= ".rtex-font-size-{$i}, #rtex-font-size-preview-{$i}{ font-size: {$font_size}em;}";
}
}

Expand Down

0 comments on commit 90c2f34

Please sign in to comment.