Browse Source

Merge pull request #2138 from Automattic/seedlet/fix/add-sanitization-callback-for-color-setting

Add a sanitize callback for the custom colors function.
Kjell Reigstad 5 years ago
parent
commit
7fbdd4847d
1 changed files with 2 additions and 1 deletions
  1. 2 1
      seedlet/classes/class-seedlet-custom-colors.php

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

@@ -183,7 +183,8 @@ class Seedlet_Custom_Colors {
 			$wp_customize->add_setting(
 				"seedlet_$variable[0]",
 				array(
-					'default'	=> esc_html( $variable[1] )
+					'default'	=> esc_html( $variable[1] ),
+					'sanitize_callback' => 'sanitize_hex_color'
 				)
 			);
 			$wp_customize->add_control( new WP_Customize_Color_Control(