updated theme GeneratePress version 3.3.0

This commit is contained in:
2023-03-29 18:20:50 +00:00
committed by Gitium
parent faf8c388d3
commit 67c318980e
25 changed files with 471 additions and 503 deletions

View File

@ -208,10 +208,27 @@ if ( ! function_exists( 'generate_sanitize_hex_color' ) ) {
return $color;
}
// Sanitize CSS variables.
if ( strpos( $color, 'var(' ) !== false ) {
return sanitize_text_field( $color );
}
// Sanitize rgb() values.
if ( strpos( $color, 'rgb(' ) !== false ) {
$color = str_replace( ' ', '', $color );
sscanf( $color, 'rgb(%d,%d,%d)', $red, $green, $blue );
return 'rgb(' . $red . ',' . $green . ',' . $blue . ')';
}
// Sanitize rgba() values.
if ( strpos( $color, 'rgba' ) !== false ) {
$color = str_replace( ' ', '', $color );
sscanf( $color, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha );
return 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $alpha . ')';
}
return '';
}
}