Browse Source

Fixes logic around when to apply custom accent colors.

Jeffrey Ong 5 years ago
parent
commit
850a0864b3
1 changed files with 3 additions and 2 deletions
  1. 3 2
      seedlet/classes/class-seedlet-custom-colors.php

+ 3 - 2
seedlet/classes/class-seedlet-custom-colors.php

@@ -212,14 +212,15 @@ class Seedlet_Custom_Colors {
 			$theme_css = ':root {';
 			$theme_css = ':root {';
 		}
 		}
 
 
+		$theme_mod_bg_color = empty( get_theme_mod( "seedlet_--global--color-background" ) ) ? '#FFFFFF' : get_theme_mod( "seedlet_--global--color-background" );
+
 		foreach ( $this->seedlet_custom_color_variables as $variable ) {
 		foreach ( $this->seedlet_custom_color_variables as $variable ) {
 
 
-			if ( '' !== get_theme_mod( "seedlet_$variable" ) ) {
+			if ( ! empty ( get_theme_mod( "seedlet_$variable[0]" )  ) ) {
 
 
 				$theme_mod_variable_name = $variable[0];
 				$theme_mod_variable_name = $variable[0];
 				$theme_mod_default_color = $variable[1];
 				$theme_mod_default_color = $variable[1];
 				$theme_mod_custom_color  = get_theme_mod( "seedlet_$variable[0]" );
 				$theme_mod_custom_color  = get_theme_mod( "seedlet_$variable[0]" );
-				$theme_mod_bg_color      = get_theme_mod( "seedlet_--global--color-background" );
 				$opacity_integer         = 70;
 				$opacity_integer         = 70;
 				$adjusted_color          = $this->seedlet_color_blend_by_opacity( $theme_mod_custom_color, $opacity_integer, $theme_mod_bg_color );
 				$adjusted_color          = $this->seedlet_color_blend_by_opacity( $theme_mod_custom_color, $opacity_integer, $theme_mod_bg_color );