Upgarded to 4.17.4

This commit is contained in:
2022-06-23 13:17:18 +01:00
parent 80f1e87db9
commit a04fb0c7af
404 changed files with 54683 additions and 4417 deletions

View File

@ -202,33 +202,10 @@ class ET_GB_Editor_Typography {
);
}
$body_font_color = esc_html( et_get_option( 'font_color' ) );
if ( ! empty( $body_font_color ) ) {
$body_styles .= et_builder_generate_css_style(
array(
'style' => 'color',
'value' => $body_font_color,
)
);
}
if ( ! empty( $body_styles ) ) {
$body_styles = sprintf( 'body { %1$s }', $body_styles );
}
$link_color = esc_html( et_get_option( 'link_color' ) );
if ( ! empty( $link_color ) ) {
$body_styles .= et_builder_generate_css(
array(
'style' => 'color',
'value' => $link_color,
'selector' => 'a',
)
);
}
return $body_styles;
}
@ -270,17 +247,6 @@ class ET_GB_Editor_Typography {
);
}
$header_color = esc_html( et_get_option( 'header_color' ) );
if ( ! empty( $header_color ) ) {
$title_styles .= et_builder_generate_css_style(
array(
'style' => 'color',
'value' => $header_color,
)
);
}
$body_header_height = esc_html( et_get_option( 'body_header_height' ) );
if ( ! empty( $body_header_height ) && '1' !== $body_header_height ) {
@ -353,11 +319,13 @@ class ET_GB_Editor_Typography {
// Get style generated by modules.
$tb_style = ET_Builder_Element::get_style();
$have_post_content_style = preg_match( '/\.et_pb_post_content_0 { (.*) }/', $tb_style, $matches );
// Remove `color` property from theme builder style.
$tb_style = preg_replace( '/(?<=[{;\s])color:.*?;/s', '', $tb_style );
$have_post_content_style = preg_match( '/\.et_pb_post_content_0\s*{\s*(.*?)\s*}/s', $tb_style, $matches );
if ( $have_post_content_style && isset( $matches[1] ) ) {
$et_pb_post_content_styles = explode( ';', $matches[1] );
$typography_properties = array(
'color',
'font-family',
'font-size',
'font-weight',
@ -375,9 +343,9 @@ class ET_GB_Editor_Typography {
foreach ( $et_pb_post_content_styles as $et_pb_post_content_style ) {
$style = explode( ':', $et_pb_post_content_style ); // explode CSS property and value.
$css_property = trim( et_()->array_get( $style, '0' ) );
$css_property = trim( $style[0] );
if ( in_array( $css_property, $typography_properties, true ) ) {
$post_content_style .= $css_property . ':' . et_()->array_get( $style, '1' ) . ';';
$post_content_style .= $css_property . ':' . $style[1] . ';';
}
}