PluginProbe ʕ •ᴥ•ʔ
Hustle – Email Marketing, Lead Generation, Optins, Popups / trunk
Hustle – Email Marketing, Lead Generation, Optins, Popups vtrunk
7.8.14 7.8.14.1 7.8.13 7.8.13.1 trunk 3.0 3.1 3.1.1 3.1.2 3.1.3 3.1.4 4.3.2 4.4.4 4.4.5 4.4.5.1 4.4.5.4 4.6 4.6.1.1 4.6.1.4 4.7.0.2 4.7.0.3 4.7.0.7 4.7.0.9 4.7.1.0 4.7.1.1 4.8.0.0 5.0.0 5.0.1 5.0.1.1 5.0.1.2 5.1 5.1.1 5.1.2 5.1.3 5.1.3.1 5.1.3.2 5.1.4 5.1.5 6.0 6.0.1 6.0.2 6.0.3 6.0.4.2 6.0.5 6.0.6.1 6.0.7 6.0.8.1 6.0.9 7.0.0.1 7.0.2 7.0.3 7.0.4 7.1.0 7.1.1 7.2.0 7.2.1 7.3.0 7.3.1 7.3.3 7.3.5 7.3.6 7.3.7 7.4.0 7.4.1 7.4.11 7.4.13 7.4.13.1 7.4.2 7.4.3 7.4.4 7.4.5 7.4.5.1 7.4.5.2 7.4.6 7.4.7 7.5.0 7.6.0 7.6.1 7.6.3 7.6.4 7.6.6 7.7.0 7.7.1 7.8.0 7.8.1 7.8.10 7.8.10.1 7.8.10.2 7.8.11 7.8.12 7.8.12.1 7.8.2 7.8.3 7.8.4 7.8.5 7.8.6 7.8.7 7.8.8 7.8.9 7.8.9.1 7.8.9.2 7.8.9.3
wordpress-popup / inc / front / non-sshare-styles / form-03--input.php
wordpress-popup / inc / front / non-sshare-styles Last commit date
form-01--form-container.php 3 years ago form-02--form-fields.php 3 years ago form-03--input.php 5 months ago form-04--select2.php 5 months ago form-05--select2-dropdown.php 3 years ago form-06--timepicker-dropdown.php 3 years ago form-07--radio.php 5 months ago form-08--checkbox.php 5 months ago form-09--calendar.php 3 years ago form-10--submit.php 5 months ago form-11--options-container.php 3 years ago form-12--options-title.php 5 months ago form-13--gdpr.php 5 months ago form-14--error-message.php 5 months ago form-15--success-message.php 2 years ago form-16--recaptcha.php 5 months ago general-01--module-container.php 3 years ago general-02--main-layout.php 1 month ago general-03--layout-header.php 3 years ago general-04--layout-content.php 3 years ago general-05--layout-footer.php 3 years ago general-06--image-size.php 5 months ago general-07--image-fitting.php 3 years ago general-08--image-position.php 5 months ago general-09--content-wrapper.php 3 years ago general-10--title.php 5 months ago general-11--subtitle.php 5 months ago general-12--content.php 5 months ago general-13--cta-container.php 3 years ago general-14--cta-button.php 5 months ago general-15--cta-alignment.php 3 years ago general-16--nsa-link.php 5 months ago general-17--close-button.php 3 years ago general-18--popup-mask.php 3 years ago general-19--cta-helper-text.php 5 months ago module-size-embed.php 5 months ago module-size-popup.php 5 months ago module-size-slidein.php 3 years ago
form-03--input.php
275 lines
1 <?php
2 /**
3 * Input Form Field.
4 *
5 * @package Hustle
6 * @since 4.3.0
7 */
8
9 global $wp_locale;
10
11 $is_rtl = $wp_locale->is_rtl();
12
13 $component = '.hustle-field .hustle-input';
14
15 // SETTINGS: Padding.
16 $padding_top = ( '' !== $advanced['input_padding_top'] ) ? $advanced['input_padding_top'] . $advanced['input_padding_unit'] : '0';
17 $padding_right = ( '' !== $advanced['input_padding_right'] ) ? $advanced['input_padding_right'] . $advanced['input_padding_unit'] : '0';
18 $padding_bottom = ( '' !== $advanced['input_padding_bottom'] ) ? $advanced['input_padding_bottom'] . $advanced['input_padding_unit'] : '0';
19 $padding_left = ( '' !== $advanced['input_padding_left'] ) ? $advanced['input_padding_left'] . $advanced['input_padding_unit'] : '0';
20
21 $padding = ( ! $is_rtl ) ? $padding_top . ' ' . $padding_right . ' ' . $padding_bottom . ' ' . $padding_left : $padding_top . ' ' . $padding_left . ' ' . $padding_bottom . ' ' . $padding_right;
22
23 $mobile_padding_top = ( '' !== $advanced['input_padding_top_mobile'] ) ? $advanced['input_padding_top_mobile'] . $advanced['input_padding_unit_mobile'] : $padding_top;
24 $mobile_padding_right = ( '' !== $advanced['input_padding_right_mobile'] ) ? $advanced['input_padding_right_mobile'] . $advanced['input_padding_unit_mobile'] : $padding_right;
25 $mobile_padding_bottom = ( '' !== $advanced['input_padding_bottom_mobile'] ) ? $advanced['input_padding_bottom_mobile'] . $advanced['input_padding_unit_mobile'] : $padding_bottom;
26 $mobile_padding_left = ( '' !== $advanced['input_padding_left_mobile'] ) ? $advanced['input_padding_left_mobile'] . $advanced['input_padding_unit_mobile'] : $padding_left;
27
28 $mobile_padding = ( ! $is_rtl ) ? $mobile_padding_top . ' ' . $mobile_padding_right . ' ' . $mobile_padding_bottom . ' ' . $mobile_padding_left : $mobile_padding_top . ' ' . $mobile_padding_left . ' ' . $mobile_padding_bottom . ' ' . $mobile_padding_right;
29 $mobile_padding = ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_advanced ) ) ? $padding : $mobile_padding;
30
31 // SETTINGS: Border.
32 $border_top = ( '' !== $advanced['input_border_top'] ) ? $advanced['input_border_top'] . $advanced['input_border_unit'] : '0';
33 $border_right = ( '' !== $advanced['input_border_right'] ) ? $advanced['input_border_right'] . $advanced['input_border_unit'] : '0';
34 $border_bottom = ( '' !== $advanced['input_border_bottom'] ) ? $advanced['input_border_bottom'] . $advanced['input_border_unit'] : '0';
35 $border_left = ( '' !== $advanced['input_border_left'] ) ? $advanced['input_border_left'] . $advanced['input_border_unit'] : '0';
36
37 $border_width = $border_top . ' ' . $border_right . ' ' . $border_bottom . ' ' . $border_left;
38 $border_style = $advanced['input_border_type'];
39
40 $border_color_default = $colors['optin_input_static_bo'];
41 $border_color_hover = $colors['optin_input_hover_bo'];
42 $border_color_focus = $colors['optin_input_active_bo'];
43 $border_color_error = $colors['optin_input_error_border'];
44
45 $mobile_border_top = ( '' !== $advanced['input_border_top_mobile'] ) ? $advanced['input_border_top_mobile'] . $advanced['input_border_unit_mobile'] : $border_top;
46 $mobile_border_right = ( '' !== $advanced['input_border_right_mobile'] ) ? $advanced['input_border_right_mobile'] . $advanced['input_border_unit_mobile'] : $border_right;
47 $mobile_border_bottom = ( '' !== $advanced['input_border_bottom_mobile'] ) ? $advanced['input_border_bottom_mobile'] . $advanced['input_border_unit_mobile'] : $border_bottom;
48 $mobile_border_left = ( '' !== $advanced['input_border_left_mobile'] ) ? $advanced['input_border_left_mobile'] . $advanced['input_border_unit_mobile'] : $border_left;
49
50 $mobile_border_width = $mobile_border_top . ' ' . $mobile_border_right . ' ' . $mobile_border_bottom . ' ' . $mobile_border_left;
51 $mobile_border_width = ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_advanced ) ) ? $border_width : $mobile_border_width;
52 $mobile_border_style = ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_advanced ) ) ? $border_style : $advanced['input_border_type_mobile'];
53
54 // SETTINGS: Border Radius.
55 $radius_topleft = ( '' !== $advanced['input_radius_top_left'] ) ? $advanced['input_radius_top_left'] . $advanced['input_radius_unit'] : '0';
56 $radius_topright = ( '' !== $advanced['input_radius_top_right'] ) ? $advanced['input_radius_top_right'] . $advanced['input_radius_unit'] : '0';
57 $radius_bottomright = ( '' !== $advanced['input_radius_bottom_right'] ) ? $advanced['input_radius_bottom_right'] . $advanced['input_radius_unit'] : '0';
58 $radius_bottomleft = ( '' !== $advanced['input_radius_bottom_left'] ) ? $advanced['input_radius_bottom_left'] . $advanced['input_radius_unit'] : '0';
59
60 $border_radius = ( ! $is_rtl ) ? $radius_topleft . ' ' . $radius_topright . ' ' . $radius_bottomright . ' ' . $radius_bottomleft : $radius_topright . ' ' . $radius_topleft . ' ' . $radius_bottomleft . ' ' . $radius_bottomright;
61
62 $mobile_radius_topleft = ( '' !== $advanced['input_radius_top_left_mobile'] ) ? $advanced['input_radius_top_left_mobile'] . $advanced['input_radius_unit_mobile'] : $radius_topleft;
63 $mobile_radius_topright = ( '' !== $advanced['input_radius_top_right_mobile'] ) ? $advanced['input_radius_top_right_mobile'] . $advanced['input_radius_unit_mobile'] : $radius_topright;
64 $mobile_radius_bottomright = ( '' !== $advanced['input_radius_bottom_right_mobile'] ) ? $advanced['input_radius_bottom_right_mobile'] . $advanced['input_radius_unit_mobile'] : $radius_bottomright;
65 $mobile_radius_bottomleft = ( '' !== $advanced['input_radius_bottom_left_mobile'] ) ? $advanced['input_radius_bottom_left_mobile'] . $advanced['input_radius_unit_mobile'] : $radius_bottomleft;
66
67 $mobile_border_radius = $mobile_radius_topleft . ' ' . $mobile_radius_topright . ' ' . $mobile_radius_bottomright . ' ' . $mobile_radius_bottomleft;
68 $mobile_border_radius = ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_advanced ) ) ? $border_radius : $mobile_border_radius;
69
70 // SETTINGS: Box Shadow.
71 $shadow_offset_x = ( '' !== $advanced['input_drop_shadow_x'] ) ? $advanced['input_drop_shadow_x'] . $advanced['input_drop_shadow_unit'] : '0';
72 $shadow_offset_y = ( '' !== $advanced['input_drop_shadow_y'] ) ? $advanced['input_drop_shadow_y'] . $advanced['input_drop_shadow_unit'] : '0';
73 $shadow_blur = ( '' !== $advanced['input_drop_shadow_blur'] ) ? $advanced['input_drop_shadow_blur'] . $advanced['input_drop_shadow_unit'] : '0';
74 $shadow_spread = ( '' !== $advanced['input_drop_shadow_spread'] ) ? $advanced['input_drop_shadow_spread'] . $advanced['input_drop_shadow_unit'] : '0';
75 $shadow_color = $colors['optin_input_drop_shadow'];
76
77 $box_shadow = $shadow_offset_x . ' ' . $shadow_offset_y . ' ' . $shadow_blur . ' ' . $shadow_spread . ' ' . $shadow_color;
78
79 $mobile_shadow_offset_x = ( '' !== $advanced['input_drop_shadow_x'] ) ? $advanced['input_drop_shadow_x'] . $advanced['input_drop_shadow_unit'] : $shadow_offset_x;
80 $mobile_shadow_offset_y = ( '' !== $advanced['input_drop_shadow_y'] ) ? $advanced['input_drop_shadow_y'] . $advanced['input_drop_shadow_unit'] : $shadow_offset_y;
81 $mobile_shadow_blur = ( '' !== $advanced['input_drop_shadow_blur'] ) ? $advanced['input_drop_shadow_blur'] . $advanced['input_drop_shadow_unit'] : $shadow_blur;
82 $mobile_shadow_spread = ( '' !== $advanced['input_drop_shadow_spread'] ) ? $advanced['input_drop_shadow_spread'] . $advanced['input_drop_shadow_unit'] : $shadow_spread;
83
84 $mobile_box_shadow = $mobile_shadow_offset_x . ' ' . $mobile_shadow_offset_y . ' ' . $mobile_shadow_blur . ' ' . $mobile_shadow_spread . ' ' . $shadow_color;
85 $mobile_box_shadow = ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_advanced ) ) ? $box_shadow : $mobile_box_shadow;
86
87 // SETTINGS: Background.
88 $background_default = $colors['optin_input_static_bg'];
89 $background_hover = $colors['optin_input_hover_bg'];
90 $background_focus = $colors['optin_input_active_bg'];
91 $background_error = $colors['optin_input_error_background'];
92
93 // SETTINGS: Font Settings.
94 $color = $colors['optin_form_field_text_static_color'];
95 $placeholder = $colors['optin_placeholder_color'];
96
97 $font_family = $typography['input_font_family'];
98 $font_size = $typography['input_font_size'] . $typography['input_font_size_unit'];
99 $font_weight = $typography['input_font_weight'];
100 $font_style = 'normal';
101 $alignment = ( ! $is_rtl ) ? $typography['input_alignment'] : 'right';
102 $line_height = $typography['input_line_height'] . $typography['input_line_height_unit'];
103 $letter_spacing = $typography['input_letter_spacing'] . $typography['input_letter_spacing_unit'];
104 $text_transform = $typography['input_text_transform'];
105
106 if ( 'custom' === $font_family ) {
107 $font_family = ( '' !== $typography['input_custom_font_family'] ) ? $typography['input_custom_font_family'] : 'inherit';
108 }
109
110 if ( 'regular' === $font_weight ) {
111 $font_weight = 'normal';
112 } elseif ( 'italic' === $font_weight ) {
113 $font_weight = 'normal';
114 $font_style = 'italic';
115 } elseif ( preg_match( '/(italic)/', $font_weight ) ) { // Check if font weight is italic.
116 $font_weight = str_replace( 'italic', '', $font_weight );
117 $font_style = 'italic';
118 }
119
120 $mobile_font_size = ( '' !== $typography['input_font_size_mobile'] ) ? $typography['input_font_size_mobile'] . $typography['input_font_size_unit_mobile'] : $font_size;
121 $mobile_font_weight = $typography['input_font_weight_mobile'];
122 $mobile_font_style = 'normal';
123 $mobile_alignment = ( ! $is_rtl ) ? $typography['input_alignment_mobile'] : 'right';
124 $mobile_line_height = ( '' !== $typography['input_line_height_mobile'] ) ? $typography['input_line_height_mobile'] . $typography['input_line_height_unit_mobile'] : $line_height;
125 $mobile_letter_spacing = ( '' !== $typography['input_letter_spacing_mobile'] ) ? $typography['input_letter_spacing_mobile'] . $typography['input_letter_spacing_unit_mobile'] : $letter_spacing;
126 $mobile_text_transform = $typography['input_text_transform'];
127
128 if ( 'regular' === $mobile_font_weight ) {
129 $mobile_font_weight = 'normal';
130 } elseif ( 'italic' === $font_weight ) {
131 $font_weight = 'normal';
132 $font_style = 'italic';
133 } elseif ( preg_match( '/(italic)/', $mobile_font_weight ) ) { // Check if font weight is italic.
134 $mobile_font_weight = str_replace( 'italic', '', $mobile_font_weight );
135 $mobile_font_style = 'italic';
136 }
137
138 if ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_typography ) ) {
139 $mobile_font_size = $font_size;
140 $mobile_font_weight = $font_weight;
141 $mobile_font_style = $font_style;
142 $mobile_alignment = $alignment;
143 $mobile_line_height = $line_height;
144 $mobile_letter_spacing = $letter_spacing;
145 $mobile_text_transform = $text_transform;
146 }
147
148 // SETTINGS: Icons.
149 $icon_color_default = $colors['optin_input_icon'];
150 $icon_color_hover = $colors['optin_input_icon_hover'];
151 $icon_color_focus = $colors['optin_input_icon_focus'];
152 $icon_color_error = $colors['optin_input_icon_error'];
153
154 // ==================================================
155 // Check if module is an opt-in.
156 if ( $is_optin ) {
157
158 $style .= ' ';
159
160 // Mobile styles.
161 $style .= $prefix_mobile . $component . ' {';
162 $style .= 'margin: 0;';
163 $style .= 'padding: ' . $mobile_padding . ';';
164 $style .= ( 'none' === $design['form_fields_icon'] ) ? '' : ( ( ! $is_rtl ) ? 'padding-left: calc(' . $mobile_padding_left . ' + 25px);' : 'padding-right: calc(' . $mobile_padding_left . ' + 25px);' );
165 $style .= 'border-width: ' . $mobile_border_width . ';';
166 $style .= 'border-style: ' . $mobile_border_style . ';';
167 $style .= ( ! $is_vanilla ) ? 'border-color: ' . $border_color_default . ';' : '';
168 $style .= 'border-radius: ' . $mobile_border_radius . ';';
169 $style .= ( ! $is_vanilla ) ? 'background-color: ' . $background_default . ';' : '';
170 $style .= ( ! $is_vanilla ) ? 'box-shadow: ' . $mobile_box_shadow . ';' : '';
171 $style .= ( ! $is_vanilla ) ? '-moz-box-shadow: ' . $mobile_box_shadow . ';' : '';
172 $style .= ( ! $is_vanilla ) ? '-webkit-box-shadow: ' . $mobile_box_shadow . ';' : '';
173 $style .= ( ! $is_vanilla ) ? 'color: ' . $color . ';' : '';
174 $style .= ( 'inherit' !== $font_family ) ? 'font: ' . $mobile_font_weight . ' ' . $mobile_font_size . '/' . $mobile_line_height . ' ' . $font_family . ';' : '';
175 $style .= ( 'inherit' === $font_family ) ? 'font-size: ' . $mobile_font_size . ';' : '';
176 $style .= ( 'inherit' === $font_family ) ? 'line-height: ' . $mobile_line_height . ';' : '';
177 $style .= ( 'inherit' === $font_family ) ? 'font-weight: ' . $mobile_font_weight . ';' : '';
178 $style .= 'font-style: ' . $mobile_font_style . ';';
179 $style .= 'letter-spacing: ' . $mobile_letter_spacing . ';';
180 $style .= 'text-transform: ' . $mobile_text_transform . ';';
181 $style .= 'text-align: ' . $mobile_alignment . ';';
182 $style .= '}';
183
184 if ( ! $is_vanilla ) {
185
186 $style .= $prefix_mobile . $component . ':hover {';
187 $style .= 'border-color: ' . $border_color_hover . ';';
188 $style .= 'background-color: ' . $background_hover . ';';
189 $style .= '}';
190
191 $style .= $prefix_mobile . $component . ':focus {';
192 $style .= 'border-color: ' . $border_color_focus . ';';
193 $style .= 'background-color: ' . $background_focus . ';';
194 $style .= '}';
195
196 $style .= $prefix_mobile . ' .hustle-field-error' . $component . ' {';
197 $style .= 'border-color: ' . $border_color_error . ' !important;';
198 $style .= 'background-color: ' . $background_error . ' !important;';
199 $style .= '}';
200 // Style default for hustle input icon.
201 $style .= $prefix_mobile . $component . ' + .hustle-input-label [class*="hustle-icon-"] {';
202 $style .= 'color: ' . $icon_color_default . ';';
203 $style .= '}';
204 // Style hover for hustle input icon.
205 $style .= $prefix_mobile . $component . ':hover + .hustle-input-label [class*="hustle-icon-"] {';
206 $style .= 'color: ' . $icon_color_hover . ';';
207 $style .= '}';
208 // Style focus for hustle input icon.
209 $style .= $prefix_mobile . $component . ':focus + .hustle-input-label [class*="hustle-icon-"] {';
210 $style .= 'color: ' . $icon_color_focus . ';';
211 $style .= '}';
212 // Style error for hustle input icon.
213 $style .= $prefix_mobile . ' .hustle-field-error' . $component . ' + .hustle-input-label [class*="hustle-icon-"] {';
214 $style .= 'color: ' . $icon_color_error . ';';
215 $style .= '}';
216 }
217
218 $style .= $prefix_mobile . $component . ' + .hustle-input-label {';
219 $style .= 'padding: ' . $mobile_padding . ';';
220 $style .= 'border-width: ' . $mobile_border_width . ';';
221 $style .= 'border-style: solid;';
222 $style .= 'border-color: transparent;';
223 $style .= ( ! $is_vanilla ) ? 'color: ' . $placeholder . ';' : '';
224 $style .= ( 'inherit' !== $font_family ) ? 'font: ' . $mobile_font_weight . ' ' . $mobile_font_size . '/' . $mobile_line_height . ' ' . $font_family . ';' : '';
225 $style .= ( 'inherit' === $font_family ) ? 'font-size: ' . $mobile_font_size . ';' : '';
226 $style .= ( 'inherit' === $font_family ) ? 'line-height: ' . $mobile_line_height . ';' : '';
227 $style .= ( 'inherit' === $font_family ) ? 'font-weight: ' . $mobile_font_weight . ';' : '';
228 $style .= 'font-style: ' . $mobile_font_style . ';';
229 $style .= 'letter-spacing: ' . $mobile_letter_spacing . ';';
230 $style .= 'text-transform: ' . $mobile_text_transform . ';';
231 $style .= 'text-align: ' . $mobile_alignment . ';';
232 $style .= '}';
233
234 // Desktop styles.
235 if ( $is_mobile_enabled ) {
236
237 $style .= $breakpoint . ' {';
238 $style .= $prefix_desktop . $component . ' {';
239 $style .= 'padding: ' . $padding . ';';
240 $style .= ( 'none' === $design['form_fields_icon'] ) ? '' : 'padding-left: calc(' . $padding_left . ' + 25px);';
241 $style .= 'border-width: ' . $border_width . ';';
242 $style .= 'border-style: ' . $border_style . ';';
243 $style .= 'border-radius: ' . $border_radius . ';';
244 $style .= ( ! $is_vanilla ) ? 'box-shadow: ' . $box_shadow . ';' : '';
245 $style .= ( ! $is_vanilla ) ? '-moz-box-shadow: ' . $box_shadow . ';' : '';
246 $style .= ( ! $is_vanilla ) ? '-webkit-box-shadow: ' . $box_shadow . ';' : '';
247 $style .= ( 'inherit' !== $font_family ) ? 'font: ' . $font_weight . ' ' . $font_size . '/' . $line_height . ' ' . $font_family . ';' : '';
248 $style .= ( 'inherit' === $font_family ) ? 'font-size: ' . $font_size . ';' : '';
249 $style .= ( 'inherit' === $font_family ) ? 'line-height: ' . $line_height . ';' : '';
250 $style .= ( 'inherit' === $font_family ) ? 'font-weight: ' . $font_weight . ';' : '';
251 $style .= 'font-style: ' . $font_style . ';';
252 $style .= 'letter-spacing: ' . $letter_spacing . ';';
253 $style .= 'text-transform: ' . $text_transform . ';';
254 $style .= 'text-align: ' . $alignment . ';';
255 $style .= '}';
256 $style .= '}';
257
258 $style .= $breakpoint . ' {';
259 $style .= $prefix_desktop . $component . ' + .hustle-input-label {';
260 $style .= 'padding: ' . $padding . ';';
261 $style .= 'border-width: ' . $border_width . ';';
262 $style .= ( 'inherit' !== $font_family ) ? 'font: ' . $font_weight . ' ' . $font_size . '/' . $line_height . ' ' . $font_family . ';' : '';
263 $style .= ( 'inherit' === $font_family ) ? 'font-size: ' . $font_size . ';' : '';
264 $style .= ( 'inherit' === $font_family ) ? 'line-height: ' . $line_height . ';' : '';
265 $style .= ( 'inherit' === $font_family ) ? 'font-weight: ' . $font_weight . ';' : '';
266 $style .= 'font-style: ' . $font_style . ';';
267 $style .= 'letter-spacing: ' . $letter_spacing . ';';
268 $style .= 'text-transform: ' . $text_transform . ';';
269 $style .= 'text-align: ' . $alignment . ';';
270 $style .= '}';
271 $style .= '}';
272
273 }
274 }
275