diff --git a/classes/helpers/FrmStylesHelper.php b/classes/helpers/FrmStylesHelper.php index 7ac733c808..11f774a3b8 100644 --- a/classes/helpers/FrmStylesHelper.php +++ b/classes/helpers/FrmStylesHelper.php @@ -484,8 +484,7 @@ public static function output_vars( $settings, $defaults = array(), $vars = arra $vars = self::get_css_vars( array_keys( $settings ) ); } - $remove = array( 'remove_box_shadow', 'remove_box_shadow_active', 'theme_css', 'theme_name', 'theme_selector', 'important_style', 'submit_style', 'collapse_icon', 'center_form', 'custom_css', 'style_class', 'submit_bg_img', 'change_margin', 'repeat_icon', 'use_base_font_size', 'field_shape_type' ); - $vars = array_diff( $vars, $remove ); + $vars = array_diff( $vars, self::get_style_keys_to_remove_from_output_vars() ); foreach ( $vars as $var ) { if ( ! isset( $settings[ $var ] ) || ! self::css_key_is_valid( $var ) ) { @@ -504,6 +503,35 @@ public static function output_vars( $settings, $defaults = array(), $vars = arra } } + /** + * None of these style settings are used as CSS variables, so we want to exclude them to keep the CSS output clean. + * + * @since x.x + * + * @return array + */ + private static function get_style_keys_to_remove_from_output_vars() { + return array( + 'remove_box_shadow', + 'remove_box_shadow_active', + 'theme_css', + 'theme_name', + 'theme_selector', + 'important_style', + 'submit_style', + 'collapse_icon', + 'center_form', + 'custom_css', + 'style_class', + 'submit_bg_img', + 'change_margin', + 'repeat_icon', + 'use_base_font_size', + 'field_shape_type', + 'bg_image_id', + ); + } + /** * Check if a CSS variable setting is not blank, doesn't match the default, and doesn't include invalid substrings. *