get_data()['settings']['color']['palette'] ?? [], 'slug' ); $out = []; foreach ( is_array( $value ) ? $value : [] as $slug => $color ) { $slug = sanitize_key( (string) $slug ); $color = is_string( $color ) ? strtolower( trim( $color ) ) : ''; if ( in_array( $slug, $known, true ) && preg_match( '/^(#[0-9a-f]{3,8}|rgba?\([0-9., %]+\))$/', $color ) ) { $out[ $slug ] = $color; } } return $out; } public static function control( string $id, string $name, $value, array $field ): string { $palette = self::sanitize( $value ); if ( ! $palette ) { return '

' . esc_html__( 'Not set: the other scheme takes the palette the theme derives (the paired variation, or the Dark variation).', 'ai-eshop-optimizer' ) . '

'; } $out = ''; } }