From 3c6ee841f63609aa260915ee3e496b0429cff2aa Mon Sep 17 00:00:00 2001 From: Jorge Costa Date: Fri, 7 Feb 2025 11:30:10 +0000 Subject: [PATCH] Fix: Warnings on any theme using customizer colors. (#41136) * Fix: Warnings on any theme using customizer colors. * changelog --- .../fix-warnings-on-any-theme-using-customizer-colors | 4 ++++ projects/plugins/wpcomsh/custom-colors/colors.php | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 projects/plugins/wpcomsh/changelog/fix-warnings-on-any-theme-using-customizer-colors diff --git a/projects/plugins/wpcomsh/changelog/fix-warnings-on-any-theme-using-customizer-colors b/projects/plugins/wpcomsh/changelog/fix-warnings-on-any-theme-using-customizer-colors new file mode 100644 index 0000000000000..da207bfd8be38 --- /dev/null +++ b/projects/plugins/wpcomsh/changelog/fix-warnings-on-any-theme-using-customizer-colors @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Fix: Undefined array key warnings on any customizer theme with colors. diff --git a/projects/plugins/wpcomsh/custom-colors/colors.php b/projects/plugins/wpcomsh/custom-colors/colors.php index b2a4405482e8d..15f56c8ee244c 100644 --- a/projects/plugins/wpcomsh/custom-colors/colors.php +++ b/projects/plugins/wpcomsh/custom-colors/colors.php @@ -1421,8 +1421,12 @@ public static function override_themecolors() { $colors = $opts['colors']; - $colors['border'] = $colors['fg1']; - $colors['url'] = $colors['link']; + if ( isset( $colors['fg1'] ) ) { + $colors['border'] = $colors['fg1']; + } + if ( isset( $colors['link'] ) ) { + $colors['url'] = $colors['link']; + } if ( isset( $colors['txt'] ) ) { $colors['text'] = $colors['txt']; }