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-04--select2.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-04--select2.php
278 lines
1 <?php
2 /**
3 * Select Form Field.
4 *
5 * @package Hustle
6 * @since 4.3.0
7 */
8
9 $component = '.hustle-select2 + .select2';
10 $component_error = '.hustle-select2.hustle-field-error + .select2';
11
12 // SETTINGS: Padding.
13 $padding_top = ( '' !== $advanced['input_padding_top'] ) ? $advanced['input_padding_top'] . $advanced['input_padding_unit'] : '0';
14 $padding_right = ( '' !== $advanced['input_padding_right'] ) ? $advanced['input_padding_right'] . $advanced['input_padding_unit'] : '0';
15 $padding_bottom = ( '' !== $advanced['input_padding_bottom'] ) ? $advanced['input_padding_bottom'] . $advanced['input_padding_unit'] : '0';
16 $padding_left = ( '' !== $advanced['input_padding_left'] ) ? $advanced['input_padding_left'] . $advanced['input_padding_unit'] : '0';
17
18 $padding = $padding_top . ' ' . $padding_right . ' ' . $padding_bottom . ' ' . $padding_left;
19
20 $mobile_padding_top = ( '' !== $advanced['input_padding_top_mobile'] ) ? $advanced['input_padding_top_mobile'] . $advanced['input_padding_unit_mobile'] : $padding_top;
21 $mobile_padding_right = ( '' !== $advanced['input_padding_right_mobile'] ) ? $advanced['input_padding_right_mobile'] . $advanced['input_padding_unit_mobile'] : $padding_right;
22 $mobile_padding_bottom = ( '' !== $advanced['input_padding_bottom_mobile'] ) ? $advanced['input_padding_bottom_mobile'] . $advanced['input_padding_unit_mobile'] : $padding_bottom;
23 $mobile_padding_left = ( '' !== $advanced['input_padding_left_mobile'] ) ? $advanced['input_padding_left_mobile'] . $advanced['input_padding_unit_mobile'] : $padding_left;
24
25 $mobile_padding = $mobile_padding_top . ' ' . $mobile_padding_right . ' ' . $mobile_padding_bottom . ' ' . $mobile_padding_left;
26 $mobile_padding = ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_advanced ) ) ? $padding : $mobile_padding;
27
28 // SETTINGS: Border.
29 $border_top = ( '' !== $advanced['input_border_top'] ) ? $advanced['input_border_top'] . $advanced['input_border_unit'] : '0';
30 $border_right = ( '' !== $advanced['input_border_right'] ) ? $advanced['input_border_right'] . $advanced['input_border_unit'] : '0';
31 $border_bottom = ( '' !== $advanced['input_border_bottom'] ) ? $advanced['input_border_bottom'] . $advanced['input_border_unit'] : '0';
32 $border_left = ( '' !== $advanced['input_border_left'] ) ? $advanced['input_border_left'] . $advanced['input_border_unit'] : '0';
33
34 $border_width = $border_top . ' ' . $border_right . ' ' . $border_bottom . ' ' . $border_left;
35 $border_style = ( '' !== $advanced['input_border_type'] ) ? $advanced['input_border_type'] : 'solid';
36
37 $border_color_default = $colors['optin_select_border'];
38 $border_color_hover = $colors['optin_select_border_hover'];
39 $border_color_open = $colors['optin_select_border_open'];
40 $border_color_error = $colors['optin_select_border_error'];
41
42 $mobile_border_top = ( '' !== $advanced['input_border_top_mobile'] ) ? $advanced['input_border_top_mobile'] . $advanced['input_border_unit_mobile'] : $border_top;
43 $mobile_border_right = ( '' !== $advanced['input_border_right_mobile'] ) ? $advanced['input_border_right_mobile'] . $advanced['input_border_unit_mobile'] : $border_right;
44 $mobile_border_bottom = ( '' !== $advanced['input_border_bottom_mobile'] ) ? $advanced['input_border_bottom_mobile'] . $advanced['input_border_unit_mobile'] : $border_bottom;
45 $mobile_border_left = ( '' !== $advanced['input_border_left_mobile'] ) ? $advanced['input_border_left_mobile'] . $advanced['input_border_unit_mobile'] : $border_left;
46
47 $mobile_border_width = $mobile_border_top . ' ' . $mobile_border_right . ' ' . $mobile_border_bottom . ' ' . $mobile_border_left;
48 $mobile_border_width = ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_advanced ) ) ? $border_width : $mobile_border_width;
49 $mobile_border_style = ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_advanced ) ) ? $border_style : $advanced['input_border_type_mobile'];
50
51 // SETTINGS: Border Radius.
52 $radius_topleft = ( '' !== $advanced['input_radius_top_left'] ) ? $advanced['input_radius_top_left'] . $advanced['input_radius_unit'] : '0';
53 $radius_topright = ( '' !== $advanced['input_radius_top_right'] ) ? $advanced['input_radius_top_right'] . $advanced['input_radius_unit'] : '0';
54 $radius_bottomright = ( '' !== $advanced['input_radius_bottom_right'] ) ? $advanced['input_radius_bottom_right'] . $advanced['input_radius_unit'] : '0';
55 $radius_bottomleft = ( '' !== $advanced['input_radius_bottom_left'] ) ? $advanced['input_radius_bottom_left'] . $advanced['input_radius_unit'] : '0';
56
57 $border_radius = $radius_topleft . ' ' . $radius_topright . ' ' . $radius_bottomright . ' ' . $radius_bottomleft;
58
59 $mobile_radius_topleft = ( '' !== $advanced['input_radius_top_left_mobile'] ) ? $advanced['input_radius_top_left_mobile'] . $advanced['input_radius_unit_mobile'] : $radius_topleft;
60 $mobile_radius_topright = ( '' !== $advanced['input_radius_top_right_mobile'] ) ? $advanced['input_radius_top_right_mobile'] . $advanced['input_radius_unit_mobile'] : $radius_topright;
61 $mobile_radius_bottomright = ( '' !== $advanced['input_radius_bottom_right_mobile'] ) ? $advanced['input_radius_bottom_right_mobile'] . $advanced['input_radius_unit_mobile'] : $radius_bottomright;
62 $mobile_radius_bottomleft = ( '' !== $advanced['input_radius_bottom_left_mobile'] ) ? $advanced['input_radius_bottom_left_mobile'] . $advanced['input_radius_unit_mobile'] : $radius_bottomleft;
63
64 $mobile_border_radius = $mobile_radius_topleft . ' ' . $mobile_radius_topright . ' ' . $mobile_radius_bottomright . ' ' . $mobile_radius_bottomleft;
65 $mobile_border_radius = ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_advanced ) ) ? $border_radius : $mobile_border_radius;
66
67 // SETTINGS: Box Shadow.
68 $shadow_offset_x = ( '' !== $advanced['input_drop_shadow_x'] ) ? $advanced['input_drop_shadow_x'] . $advanced['input_drop_shadow_unit'] : '0';
69 $shadow_offset_y = ( '' !== $advanced['input_drop_shadow_y'] ) ? $advanced['input_drop_shadow_y'] . $advanced['input_drop_shadow_unit'] : '0';
70 $shadow_blur = ( '' !== $advanced['input_drop_shadow_blur'] ) ? $advanced['input_drop_shadow_blur'] . $advanced['input_drop_shadow_unit'] : '0';
71 $shadow_spread = ( '' !== $advanced['input_drop_shadow_spread'] ) ? $advanced['input_drop_shadow_spread'] . $advanced['input_drop_shadow_unit'] : '0';
72 $shadow_color = $colors['optin_input_drop_shadow'];
73
74 $box_shadow = $shadow_offset_x . ' ' . $shadow_offset_y . ' ' . $shadow_blur . ' ' . $shadow_spread . ' ' . $shadow_color;
75
76 $mobile_shadow_offset_x = ( '' !== $advanced['input_drop_shadow_x'] ) ? $advanced['input_drop_shadow_x'] . $advanced['input_drop_shadow_unit'] : $shadow_offset_x;
77 $mobile_shadow_offset_y = ( '' !== $advanced['input_drop_shadow_y'] ) ? $advanced['input_drop_shadow_y'] . $advanced['input_drop_shadow_unit'] : $shadow_offset_y;
78 $mobile_shadow_blur = ( '' !== $advanced['input_drop_shadow_blur'] ) ? $advanced['input_drop_shadow_blur'] . $advanced['input_drop_shadow_unit'] : $shadow_blur;
79 $mobile_shadow_spread = ( '' !== $advanced['input_drop_shadow_spread'] ) ? $advanced['input_drop_shadow_spread'] . $advanced['input_drop_shadow_unit'] : $shadow_spread;
80
81 $mobile_box_shadow = $mobile_shadow_offset_x . ' ' . $mobile_shadow_offset_y . ' ' . $mobile_shadow_blur . ' ' . $mobile_shadow_spread . ' ' . $shadow_color;
82 $mobile_box_shadow = ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_advanced ) ) ? $box_shadow : $mobile_box_shadow;
83
84 // SETTINGS: Background.
85 $background_default = $colors['optin_select_background'];
86 $background_hover = $colors['optin_select_background_hover'];
87 $background_open = $colors['optin_select_background_open'];
88 $background_error = $colors['optin_select_background_error'];
89
90 // SETTINGS: Font Settings.
91 $color = $colors['optin_select_label'];
92 $placeholder = $colors['optin_select_placeholder'];
93
94 $font_family = $typography['input_font_family'];
95 $font_size = $typography['input_font_size'] . $typography['input_font_size_unit'];
96 $font_weight = $typography['input_font_weight'];
97 $font_style = 'normal';
98 $alignment = $typography['input_alignment'];
99 $line_height = $typography['input_line_height'] . $typography['input_line_height_unit'];
100 $letter_spacing = $typography['input_letter_spacing'] . $typography['input_letter_spacing_unit'];
101 $text_transform = $typography['input_text_transform'];
102
103 if ( 'custom' === $font_family ) {
104 $font_family = ( '' !== $typography['input_custom_font_family'] ) ? $typography['input_custom_font_family'] : 'inherit';
105 }
106
107 if ( 'regular' === $font_weight ) {
108 $font_weight = 'normal';
109 } elseif ( 'italic' === $font_weight ) {
110 $font_weight = 'normal';
111 $font_style = 'italic';
112 } elseif ( preg_match( '/(italic)/', $font_weight ) ) {// Check if font weight is italic.
113 $font_weight = str_replace( 'italic', '', $font_weight );
114 $font_style = 'italic';
115 }
116
117 $mobile_font_size = ( '' !== $typography['input_font_size_mobile'] ) ? $typography['input_font_size_mobile'] . $typography['input_font_size_unit_mobile'] : $font_size;
118 $mobile_font_weight = $typography['input_font_weight_mobile'];
119 $mobile_font_style = 'normal';
120 $mobile_alignment = $typography['input_alignment_mobile'];
121 $mobile_line_height = ( '' !== $typography['input_line_height_mobile'] ) ? $typography['input_line_height_mobile'] . $typography['input_line_height_unit_mobile'] : $line_height;
122 $mobile_letter_spacing = ( '' !== $typography['input_letter_spacing_mobile'] ) ? $typography['input_letter_spacing_mobile'] . $typography['input_letter_spacing_unit_mobile'] : $letter_spacing;
123 $mobile_text_transform = $typography['input_text_transform'];
124
125 if ( 'regular' === $mobile_font_weight ) {
126 $mobile_font_weight = 'normal';
127 } elseif ( 'italic' === $font_weight ) {
128 $font_weight = 'normal';
129 $font_style = 'italic';
130 } elseif ( preg_match( '/(italic)/', $mobile_font_weight ) ) {// Check if font weight is italic.
131 $mobile_font_weight = str_replace( 'italic', '', $mobile_font_weight );
132 $mobile_font_style = 'italic';
133 }
134
135 if ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_typography ) ) {
136 $mobile_font_size = $font_size;
137 $mobile_font_weight = $font_weight;
138 $mobile_font_style = $font_style;
139 $mobile_alignment = $alignment;
140 $mobile_line_height = $line_height;
141 $mobile_letter_spacing = $letter_spacing;
142 $mobile_text_transform = $text_transform;
143 }
144
145 // SETTINGS: Icons.
146 $icon_color_default = $colors['optin_select_icon'];
147 $icon_color_hover = $colors['optin_select_icon_hover'];
148 $icon_color_open = $colors['optin_select_icon_open'];
149 $icon_color_error = $colors['optin_select_icon_error'];
150
151 // ==================================================
152 // Check if module is an opt-in.
153 if ( $is_optin ) {
154
155 $style .= ' ';
156
157 $style .= $prefix_mobile . $component . ' {';
158 $style .= 'box-shadow: ' . $mobile_box_shadow . ';';
159 $style .= '-moz-box-shadow: ' . $mobile_box_shadow . ';';
160 $style .= '-webkit-box-shadow: ' . $mobile_box_shadow . ';';
161 $style .= '}';
162
163 $style .= $prefix_mobile . $component . ' .select2-selection--single {';
164 $style .= 'margin: 0;';
165 $style .= 'padding: 0 ' . $mobile_padding_right . ' 0 ' . $mobile_padding_left . ';';
166 $style .= 'border-width: ' . $mobile_border_width . ';';
167 $style .= 'border-style: ' . $mobile_border_style . ';';
168 $style .= ( ! $is_vanilla ) ? 'border-color: ' . $border_color_default . ';' : '';
169 $style .= 'border-radius: ' . $mobile_border_radius . ';';
170 $style .= 'background-color: ' . $background_hover . ';';
171 $style .= '}';
172
173 $style .= $prefix_mobile . $component . ' .select2-selection--single .select2-selection__rendered {';
174 $style .= 'padding: ' . $mobile_padding_top . ' 0 ' . $mobile_padding_bottom . ' 0;';
175 $style .= ( ! $is_vanilla ) ? 'color: ' . $color . ';' : '';
176 $style .= ( 'inherit' !== $font_family ) ? 'font: ' . $mobile_font_weight . ' ' . $mobile_font_size . '/' . $mobile_line_height . ' ' . $font_family . ';' : '';
177 $style .= ( 'inherit' === $font_family ) ? 'font-size: ' . $mobile_font_size . ';' : '';
178 $style .= ( 'inherit' === $font_family ) ? 'line-height: ' . $mobile_line_height . ';' : '';
179 $style .= ( 'inherit' === $font_family ) ? 'font-weight: ' . $mobile_font_weight . ';' : '';
180 $style .= 'font-style: ' . $mobile_font_style . ';';
181 $style .= '}';
182
183 if ( ! $is_vanilla ) {
184
185 $style .= $prefix_mobile . $component . ' .select2-selection--single .select2-selection__rendered .select2-selection__placeholder {';
186 $style .= 'color: ' . $placeholder . ';';
187 $style .= '}';
188
189 $style .= $prefix_mobile . $component . ':hover .select2-selection--single {';
190 $style .= 'border-color: ' . $border_color_hover . ';';
191 $style .= 'background-color: ' . $background_hover . ';';
192 $style .= '}';
193
194 $style .= $prefix_mobile . $component . '.select2-container--open .select2-selection--single {';
195 $style .= 'border-color: ' . $border_color_open . ';';
196 $style .= 'background-color: ' . $background_open . ';';
197 $style .= '}';
198
199 $style .= $prefix_mobile . $component_error . ' .select2-selection--single {';
200 $style .= 'border-color: ' . $border_color_error . ' !important;';
201 $style .= 'background-color: ' . $background_error . ' !important;';
202 $style .= '}';
203
204 }
205
206 $style .= $prefix_mobile . $component . ' + .hustle-input-label {';
207 $style .= ( ! $is_vanilla ) ? 'color: ' . $placeholder . ';' : '';
208 $style .= ( 'inherit' !== $font_family ) ? 'font: ' . $mobile_font_weight . ' ' . $mobile_font_size . '/' . $mobile_line_height . ' ' . $font_family . ';' : '';
209 $style .= ( 'inherit' === $font_family ) ? 'font-size: ' . $mobile_font_size . ';' : '';
210 $style .= ( 'inherit' === $font_family ) ? 'line-height: ' . $mobile_line_height . ';' : '';
211 $style .= ( 'inherit' === $font_family ) ? 'font-weight: ' . $mobile_font_weight . ';' : '';
212 $style .= 'font-style: ' . $mobile_font_style . ';';
213 $style .= 'letter-spacing: ' . $mobile_letter_spacing . ';';
214 $style .= 'text-transform: ' . $mobile_text_transform . ';';
215 $style .= 'text-align: ' . $mobile_alignment . ';';
216 $style .= '}';
217
218 if ( ! $is_vanilla ) {
219
220 $style .= $prefix_mobile . $component . ' .select2-selection--single .select2-selection__arrow {';
221 $style .= 'color: ' . $icon_color_default . ';';
222 $style .= '}';
223
224 $style .= $prefix_mobile . $component . ':hover .select2-selection--single .select2-selection__arrow {';
225 $style .= 'color: ' . $icon_color_hover . ';';
226 $style .= '}';
227
228 $style .= $prefix_mobile . $component . '.select2-container--open .select2-selection--single .select2-selection__arrow {';
229 $style .= 'color: ' . $icon_color_open . ';';
230 $style .= '}';
231
232 $style .= $prefix_mobile . $component_error . ' .select2-selection--single .select2-selection__arrow {';
233 $style .= 'color: ' . $icon_color_error . ' !important;';
234 $style .= '}';
235
236 }
237
238 // Desktop styles.
239 if ( $is_mobile_enabled ) {
240
241 $style .= $breakpoint . ' {';
242 $style .= $prefix_desktop . $component . ' {';
243 $style .= 'box-shadow: ' . $box_shadow . ';';
244 $style .= '-moz-box-shadow: ' . $box_shadow . ';';
245 $style .= '-webkit-box-shadow: ' . $box_shadow . ';';
246 $style .= '}';
247 $style .= $prefix_desktop . $component . ' .select2-selection--single {';
248 $style .= 'padding: 0 ' . $padding_right . ' 0 ' . $padding_left . ';';
249 $style .= 'border-width: ' . $border_width . ';';
250 $style .= 'border-style: ' . $border_style . ';';
251 $style .= 'border-radius: ' . $border_radius . ';';
252 $style .= '}';
253 $style .= $prefix_desktop . $component . ' .select2-selection--single .select2-selection__rendered {';
254 $style .= 'padding: ' . $padding_top . ' 0 ' . $padding_bottom . ' 0;';
255 $style .= ( 'inherit' !== $font_family ) ? 'font: ' . $font_weight . ' ' . $font_size . '/' . $line_height . ' ' . $font_family . ';' : '';
256 $style .= ( 'inherit' === $font_family ) ? 'font-size: ' . $font_size . ';' : '';
257 $style .= ( 'inherit' === $font_family ) ? 'line-height: ' . $line_height . ';' : '';
258 $style .= ( 'inherit' === $font_family ) ? 'font-weight: ' . $font_weight . ';' : '';
259 $style .= 'font-style: ' . $font_style . ';';
260 $style .= 'letter-spacing: ' . $letter_spacing . ';';
261 $style .= 'text-transform: ' . $text_transform . ';';
262 $style .= 'text-align: ' . $alignment . ';';
263 $style .= '}';
264 $style .= $prefix_desktop . $component . ' + .hustle-input-label {';
265 $style .= ( 'inherit' !== $font_family ) ? 'font: ' . $font_weight . ' ' . $font_size . '/' . $line_height . ' ' . $font_family . ';' : '';
266 $style .= ( 'inherit' === $font_family ) ? 'font-size: ' . $font_size . ';' : '';
267 $style .= ( 'inherit' === $font_family ) ? 'line-height: ' . $line_height . ';' : '';
268 $style .= ( 'inherit' === $font_family ) ? 'font-weight: ' . $font_weight . ';' : '';
269 $style .= 'font-style: ' . $font_style . ';';
270 $style .= 'letter-spacing: ' . $mobile_letter_spacing . ';';
271 $style .= 'text-transform: ' . $mobile_text_transform . ';';
272 $style .= 'text-align: ' . $mobile_alignment . ';';
273 $style .= '}';
274 $style .= '}';
275
276 }
277 }
278