PluginProbe
Filter Gallery / trunk
Filter Gallery vtrunk
1.1.4 1.1.3 1.1.2 trunk 0.0.1 0.0.2 0.0.3 0.0.4 0.0.5 0.0.6 0.0.7 0.0.8 0.0.9 0.1.0 0.1.1 0.1.2 0.1.3 0.1.4 0.1.5 0.1.6 0.1.7 0.1.8 0.1.9 0.2.0 0.2.1 All 27 releases
filter-gallery / setting.php

setting.php in Filter Gallery trunk, at setting.php

646 lines 22.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('ABSPATH'))
3 exit; // Exit if accessed directly
4
5 // load gallery settings
6 if (isset($atts['show_filters']) && $atts['show_filters'] !== '') {
7 $ufg_show_filters = $atts['show_filters']; //shortcode
8 } else {
9 if (isset($ufg_setting['show_filters']) && $ufg_setting['show_filters'] !== '') {
10 $ufg_show_filters = $ufg_setting['show_filters']; //saved
11 } else {
12 $ufg_show_filters = 1; // default
13 }
14 }
15
16 if (isset($atts['show_filters_icon'])) {
17 $ufg_show_filters_icon = $atts['show_filters_icon']; //shortcode
18 } else {
19 if (isset($ufg_setting['show_filters_icon'])) {
20 $ufg_show_filters_icon = $ufg_setting['show_filters_icon']; //saved
21 } else {
22 $ufg_show_filters_icon = 1; // default
23 }
24 }
25
26 $ufg_enable_deep_linking = 0;
27
28 if (isset($atts['show_filters_count'])) {
29 $ufg_show_filters_count = $atts['show_filters_count']; //shortcode
30 } else {
31 if (isset($ufg_setting['show_filters_count'])) {
32 $ufg_show_filters_count = $ufg_setting['show_filters_count']; //saved
33 } else {
34 $ufg_show_filters_count = 1; // default (was 0)
35 }
36 }
37
38 if (isset($atts['show_all_button'])) {
39 $ufg_show_all_button = $atts['show_all_button']; //shortcode
40 } else {
41 if (isset($ufg_setting['show_all_button'])) {
42 $ufg_show_all_button = $ufg_setting['show_all_button']; //saved
43 } else {
44 $ufg_show_all_button = 1; // default (was 0)
45 }
46 }
47
48 if (isset($atts['all_button_text'])) {
49 $ufg_all_button_text = $atts['all_button_text']; //shortcode
50 } else {
51 if (isset($ufg_setting['all_button_text'])) {
52 $ufg_all_button_text = $ufg_setting['all_button_text']; //saved
53 } else {
54 $ufg_all_button_text = __('All', 'filter-gallery'); // default
55 }
56 }
57 if (isset($atts['all_button_icon'])) {
58 $ufg_all_button_icon = $atts['all_button_icon']; //shortcode
59 } else {
60 if (isset($ufg_setting['all_button_icon']) && $ufg_setting['all_button_icon'] !== '') {
61 $ufg_all_button_icon = $ufg_setting['all_button_icon']; //saved
62 } else {
63 $ufg_all_button_icon = 'fas fa-filter'; // default
64 }
65 }
66 if (isset($atts['child_filter_effect'])) {
67 $ufg_child_filter_effect = $atts['child_filter_effect']; //shortcode
68 } else {
69 if (isset($ufg_setting['child_filter_effect'])) {
70 $ufg_child_filter_effect = $ufg_setting['child_filter_effect']; //saved
71 } else {
72 $ufg_child_filter_effect = 'show_hide'; // default
73 }
74 }
75
76 if (isset($atts['all_button_color'])) {
77 $ufg_all_button_color = $atts['all_button_color']; //shortcode
78 } else {
79 if (isset($ufg_setting['all_button_color']) && $ufg_setting['all_button_color'] !== '') {
80 $ufg_all_button_color = $ufg_setting['all_button_color']; //saved
81 } else {
82 $ufg_all_button_color = "#ffffff"; // default
83 }
84 }
85
86 if (isset($atts['all_button_bg_color'])) {
87 $ufg_all_button_bg_color = $atts['all_button_bg_color']; //shortcode
88 } else {
89 if (isset($ufg_setting['all_button_bg_color']) && $ufg_setting['all_button_bg_color'] !== '') {
90 $ufg_all_button_bg_color = $ufg_setting['all_button_bg_color']; //saved
91 } else {
92 $ufg_all_button_bg_color = "#0A85ED"; // default
93 }
94 }
95
96 if (isset($atts['parent_button_color'])) {
97 $ufg_parent_button_color = $atts['parent_button_color']; //shortcode
98 } else {
99 if (isset($ufg_setting['parent_button_color']) && $ufg_setting['parent_button_color'] !== '') {
100 $ufg_parent_button_color = $ufg_setting['parent_button_color']; //saved
101 } else {
102 $ufg_parent_button_color = "#4F46E5"; // default
103 }
104 }
105
106 if (isset($atts['parent_button_bg_color'])) {
107 $ufg_parent_button_bg_color = $atts['parent_button_bg_color']; //shortcode
108 } else {
109 if (isset($ufg_setting['parent_button_bg_color']) && $ufg_setting['parent_button_bg_color'] !== '') {
110 $ufg_parent_button_bg_color = $ufg_setting['parent_button_bg_color']; //saved
111 } else {
112 $ufg_parent_button_bg_color = "#EEF2FF"; // default
113 }
114 }
115
116 if (isset($atts['parent_button_hover_color'])) {
117 $parent_button_hover_color = $atts['parent_button_hover_color'];
118 } else {
119 if (isset($ufg_setting['parent_button_hover_color']) && $ufg_setting['parent_button_hover_color'] !== '') {
120 $parent_button_hover_color = $ufg_setting['parent_button_hover_color'];
121 } else {
122 $parent_button_hover_color = "#000000"; // default
123 }
124 }
125
126 if (isset($atts['parent_active_button_color'])) {
127 $parent_active_button_color = $atts['parent_active_button_color'];
128 } else {
129 if (isset($ufg_setting['parent_active_button_color']) && $ufg_setting['parent_active_button_color'] !== '') {
130 $parent_active_button_color = $ufg_setting['parent_active_button_color'];
131 } else {
132 $parent_active_button_color = "#FFFFFF"; // default
133 }
134 }
135
136 if (isset($atts['parent_active_button_bg_color'])) {
137 $parent_active_button_bg_color = $atts['parent_active_button_bg_color'];
138 } else {
139 if (isset($ufg_setting['parent_active_button_bg_color']) && $ufg_setting['parent_active_button_bg_color'] !== '') {
140 $parent_active_button_bg_color = $ufg_setting['parent_active_button_bg_color'];
141 } else {
142 $parent_active_button_bg_color = "#4F46E5"; // default
143 }
144 }
145
146 if (isset($atts['l1_button_color'])) {
147 $ufg_l1_button_color = $atts['l1_button_color']; //shortcode
148 } else {
149 if (isset($ufg_setting['l1_button_color']) && $ufg_setting['l1_button_color'] !== '') {
150 $ufg_l1_button_color = $ufg_setting['l1_button_color']; //saved
151 } else {
152 $ufg_l1_button_color = "#4F46E5"; // default
153 }
154 }
155
156 if (isset($atts['l1_button_bg_color'])) {
157 $ufg_l1_button_bg_color = $atts['l1_button_bg_color']; //shortcode
158 } else {
159 if (isset($ufg_setting['l1_button_bg_color']) && $ufg_setting['l1_button_bg_color'] !== '') {
160 $ufg_l1_button_bg_color = $ufg_setting['l1_button_bg_color']; //saved
161 } else {
162 $ufg_l1_button_bg_color = "#EEF2FF"; // default
163 }
164 }
165
166 if (isset($atts['active_button_color'])) {
167 $ufg_active_button_color = $atts['active_button_color']; //shortcode
168 } else {
169 if (isset($ufg_setting['active_button_color']) && $ufg_setting['active_button_color'] !== '') {
170 $ufg_active_button_color = $ufg_setting['active_button_color']; //saved
171 } else {
172 $ufg_active_button_color = "#FFFFFF"; // default
173 }
174 }
175
176 if (isset($atts['active_button_bg_color'])) {
177 $ufg_active_button_bg_color = $atts['active_button_bg_color']; //shortcode
178 } else {
179 if (isset($ufg_setting['active_button_bg_color']) && $ufg_setting['active_button_bg_color'] !== '') {
180 $ufg_active_button_bg_color = $ufg_setting['active_button_bg_color']; //saved
181 } else {
182 $ufg_active_button_bg_color = "#0C63E7"; // default
183 }
184 }
185
186 if (isset($atts['l2_button_color'])) {
187 $ufg_l2_button_color = $atts['l2_button_color']; //shortcode
188 } else {
189 if (isset($ufg_setting['l2_button_color']) && $ufg_setting['l2_button_color'] !== '') {
190 $ufg_l2_button_color = $ufg_setting['l2_button_color']; //saved
191 } else {
192 $ufg_l2_button_color = "#4F46E5"; // default
193 }
194 }
195
196 if (isset($atts['l2_button_bg_color'])) {
197 $ufg_l2_button_bg_color = $atts['l2_button_bg_color']; //shortcode
198 } else {
199 if (isset($ufg_setting['l2_button_bg_color']) && $ufg_setting['l2_button_bg_color'] !== '') {
200 $ufg_l2_button_bg_color = $ufg_setting['l2_button_bg_color']; //saved
201 } else {
202 $ufg_l2_button_bg_color = "#EEF2FF"; // default
203 }
204 }
205
206 if (isset($atts['l3_button_color'])) {
207 $ufg_l3_button_color = $atts['l3_button_color']; //shortcode
208 } else {
209 if (isset($ufg_setting['l3_button_color']) && $ufg_setting['l3_button_color'] !== '') {
210 $ufg_l3_button_color = $ufg_setting['l3_button_color']; //saved
211 } else {
212 $ufg_l3_button_color = "#4F46E5"; // default
213 }
214 }
215
216 if (isset($atts['l3_button_bg_color'])) {
217 $ufg_l3_button_bg_color = $atts['l3_button_bg_color']; //shortcode
218 } else {
219 if (isset($ufg_setting['l3_button_bg_color']) && $ufg_setting['l3_button_bg_color'] !== '') {
220 $ufg_l3_button_bg_color = $ufg_setting['l3_button_bg_color']; //saved
221 } else {
222 $ufg_l3_button_bg_color = "#EEF2FF"; // default
223 }
224 }
225
226 if (isset($atts['l4_button_color'])) {
227 $ufg_l4_button_color = $atts['l4_button_color']; //shortcode
228 } else {
229 if (isset($ufg_setting['l4_button_color']) && $ufg_setting['l4_button_color'] !== '') {
230 $ufg_l4_button_color = $ufg_setting['l4_button_color']; //saved
231 } else {
232 $ufg_l4_button_color = "#4F46E5"; // default
233 }
234 }
235
236 if (isset($atts['l4_button_bg_color'])) {
237 $ufg_l4_button_bg_color = $atts['l4_button_bg_color']; //shortcode
238 } else {
239 if (isset($ufg_setting['l4_button_bg_color']) && $ufg_setting['l4_button_bg_color'] !== '') {
240 $ufg_l4_button_bg_color = $ufg_setting['l4_button_bg_color']; //saved
241 } else {
242 $ufg_l4_button_bg_color = "#EEF2FF"; // default
243 }
244 }
245
246 if (!empty($atts['columns_desktop'])) {
247 $ufg_columns_desktop_raw = $atts['columns_desktop'];
248 } else {
249 if (!empty($ufg_setting['columns_desktop'])) {
250 $ufg_columns_desktop_raw = $ufg_setting['columns_desktop'];
251 } else {
252 $ufg_columns_desktop_raw = 4; // default 4 columns (col-3)
253 }
254 }
255 if (!in_array((string)$ufg_columns_desktop_raw, array('3', '4', '6'), true)) {
256 $ufg_columns_desktop_raw = 4;
257 }
258 // Map count to span: 1->12, 2->6, 3->4, 4->3, 6->2, 12->1
259 $col_map = array('1' => '12', '2' => '6', '3' => '4', '4' => '3', '6' => '2', '12' => '1');
260 $ufg_columns_desktop = isset($col_map[$ufg_columns_desktop_raw]) ? $col_map[$ufg_columns_desktop_raw] : $ufg_columns_desktop_raw;
261
262 if (!empty($atts['columns_tab'])) {
263 $ufg_columns_tab_raw = $atts['columns_tab'];
264 } else {
265 if (!empty($ufg_setting['columns_tab'])) {
266 $ufg_columns_tab_raw = $ufg_setting['columns_tab'];
267 } else {
268 $ufg_columns_tab_raw = 3;
269 }
270 }
271 if (!in_array((string)$ufg_columns_tab_raw, array('1', '2', '3'), true)) {
272 $ufg_columns_tab_raw = 3;
273 }
274 $ufg_columns_tab = isset($col_map[$ufg_columns_tab_raw]) ? $col_map[$ufg_columns_tab_raw] : $ufg_columns_tab_raw;
275
276 if (!empty($atts['columns_mobile_landscape'])) {
277 $ufg_columns_mobile_landscape_raw = $atts['columns_mobile_landscape'];
278 } else {
279 if (!empty($ufg_setting['columns_mobile_landscape'])) {
280 $ufg_columns_mobile_landscape_raw = $ufg_setting['columns_mobile_landscape'];
281 } else {
282 $ufg_columns_mobile_landscape_raw = 3;
283 }
284 }
285 if (!in_array((string)$ufg_columns_mobile_landscape_raw, array('1', '2', '3'), true)) {
286 $ufg_columns_mobile_landscape_raw = 3;
287 }
288 $ufg_columns_mobile_landscape = isset($col_map[$ufg_columns_mobile_landscape_raw]) ? $col_map[$ufg_columns_mobile_landscape_raw] : $ufg_columns_mobile_landscape_raw;
289
290 if (!empty($atts['columns_mobile_portrait'])) {
291 $ufg_columns_mobile_portrait_raw = $atts['columns_mobile_portrait'];
292 } else {
293 if (!empty($ufg_setting['columns_mobile_portrait'])) {
294 $ufg_columns_mobile_portrait_raw = $ufg_setting['columns_mobile_portrait'];
295 } else {
296 $ufg_columns_mobile_portrait_raw = 2;
297 }
298 }
299 if (!in_array((string)$ufg_columns_mobile_portrait_raw, array('1', '2'), true)) {
300 $ufg_columns_mobile_portrait_raw = 2;
301 }
302 $ufg_columns_mobile_portrait = isset($col_map[$ufg_columns_mobile_portrait_raw]) ? $col_map[$ufg_columns_mobile_portrait_raw] : $ufg_columns_mobile_portrait_raw;
303
304 $ufg_thumbnail_image = 1; // Always show thumbnails
305
306 if (isset($atts['thumbnail_image_size'])) {
307 $ufg_thumbnail_image_size = $atts['thumbnail_image_size']; //shortcode
308 } else {
309 if (isset($ufg_setting['thumbnail_image_size'])) {
310 $ufg_thumbnail_image_size = $ufg_setting['thumbnail_image_size']; //saved
311 } else {
312 $ufg_thumbnail_image_size = "full"; // default
313 }
314 }
315
316 if (isset($atts['thumbnail_border'])) {
317 $ufg_thumbnail_border = $atts['thumbnail_border']; //shortcode
318 } else {
319 if (isset($ufg_setting['thumbnail_border'])) {
320 $ufg_thumbnail_border = $ufg_setting['thumbnail_border']; //saved
321 } else {
322 $ufg_thumbnail_border = 1; // default
323 }
324 }
325
326 if (isset($atts['thumbnail_border_thickness'])) {
327 $ufg_thumbnail_border_thickness = $atts['thumbnail_border_thickness']; //shortcode
328 } else {
329 if (isset($ufg_setting['thumbnail_border_thickness']) && $ufg_setting['thumbnail_border_thickness'] !== '') {
330 $ufg_thumbnail_border_thickness = $ufg_setting['thumbnail_border_thickness']; //saved
331 } else {
332 $ufg_thumbnail_border_thickness = 1; // default
333 }
334 }
335
336 if (isset($atts['thumbnail_border_color'])) {
337 $ufg_thumbnail_border_color = $atts['thumbnail_border_color']; //shortcode
338 } else {
339 if (isset($ufg_setting['thumbnail_border_color']) && $ufg_setting['thumbnail_border_color'] !== '') {
340 $ufg_thumbnail_border_color = $ufg_setting['thumbnail_border_color']; //saved
341 } else {
342 $ufg_thumbnail_border_color = "#ffffff"; // default
343 }
344 }
345
346 if (isset($atts['thumbnail_bg_color'])) {
347 $ufg_thumbnail_bg_color = $atts['thumbnail_bg_color']; //shortcode
348 } else {
349 if (isset($ufg_setting['thumbnail_bg_color']) && $ufg_setting['thumbnail_bg_color'] !== '') {
350 $ufg_thumbnail_bg_color = $ufg_setting['thumbnail_bg_color']; //saved
351 } else {
352 $ufg_thumbnail_bg_color = "#222a33"; // default
353 }
354 }
355
356 if (isset($atts['image_title']) && $atts['image_title'] !== '') {
357 $ufg_image_title = $atts['image_title']; //shortcode
358 } else {
359 if (isset($ufg_setting['image_title']) && $ufg_setting['image_title'] !== '') {
360 $ufg_image_title = $ufg_setting['image_title']; //saved
361 } else {
362 $ufg_image_title = 1; // default
363 }
364 }
365
366 if (isset($atts['image_title_font_size'])) {
367 $ufg_image_title_font_size = $atts['image_title_font_size']; //shortcode
368 } else {
369 if (isset($ufg_setting['image_title_font_size'])) {
370 $ufg_image_title_font_size = $ufg_setting['image_title_font_size']; //saved
371 } else {
372 $ufg_image_title_font_size = 18; // default (was 45)
373 }
374 }
375
376 if (isset($atts['image_title_color'])) {
377 $ufg_image_title_color = $atts['image_title_color']; //shortcode
378 } else {
379 if (isset($ufg_setting['image_title_color']) && $ufg_setting['image_title_color'] !== '') {
380 $ufg_image_title_color = $ufg_setting['image_title_color']; //saved
381 } else {
382 $ufg_image_title_color = "#FFFFFF"; // default
383 }
384 }
385
386 if (isset($atts['image_description']) && $atts['image_description'] !== '') {
387 $ufg_image_description = $atts['image_description']; //shortcode
388 } else {
389 if (isset($ufg_setting['image_description']) && $ufg_setting['image_description'] !== '') {
390 $ufg_image_description = $ufg_setting['image_description']; //saved
391 } else {
392 $ufg_image_description = 1; // default
393 }
394 }
395
396 if (isset($atts['image_description_font_size'])) {
397 $ufg_image_description_font_size = $atts['image_description_font_size']; //shortcode
398 } else {
399 if (isset($ufg_setting['image_description_font_size']) && $ufg_setting['image_description_font_size'] !== '') {
400 $ufg_image_description_font_size = $ufg_setting['image_description_font_size']; //saved
401 } else {
402 $ufg_image_description_font_size = 14; // default (was 1)
403 }
404 }
405
406 if (isset($atts['image_description_color'])) {
407 $ufg_image_description_color = $atts['image_description_color']; //shortcode
408 } else {
409 if (isset($ufg_setting['image_description_color']) && $ufg_setting['image_description_color'] !== '') {
410 $ufg_image_description_color = $ufg_setting['image_description_color']; //saved
411 } else {
412 $ufg_image_description_color = "#FFFFFF"; // default
413 }
414 }
415
416 if (isset($atts['image_description_text_limit'])) {
417 $ufg_image_description_text_limit = $atts['image_description_text_limit']; //shortcode
418 } else {
419 if (isset($ufg_setting['image_description_text_limit']) && $ufg_setting['image_description_text_limit'] !== '') {
420 $ufg_image_description_text_limit = $ufg_setting['image_description_text_limit']; //saved
421 } else {
422 $ufg_image_description_text_limit = 60; // default
423 }
424 }
425
426 $ufg_read_more_link_sh = 0;
427 $ufg_read_more_link = 1;
428 $ufg_read_more_button_text = 'Read More Link';
429 $ufg_read_more_button_icon = 'fas fa-link';
430 $ufg_read_more_button_color = '#ffffff';
431 $ufg_read_more_button_bg_color = '#0080ff';
432 $ufg_read_more_button_target = '_self';
433
434 if (isset($atts['image_hover_effect'])) {
435 $ufg_image_hover_effect = $atts['image_hover_effect']; //shortcode
436 } else {
437 if (isset($ufg_setting['image_hover_effect']) && $ufg_setting['image_hover_effect'] !== '') {
438 $ufg_image_hover_effect = $ufg_setting['image_hover_effect']; //saved
439 } else {
440 $ufg_image_hover_effect = 'border_overlay'; // default (was none)
441 }
442 }
443
444 if (isset($atts['pagination'])) {
445 $ufg_pagination = $atts['pagination']; //shortcode
446 } else {
447 if (isset($ufg_setting['pagination'])) {
448 $ufg_pagination = $ufg_setting['pagination']; //saved
449 } else {
450 $ufg_pagination = 1; // default
451 }
452 }
453
454 if (isset($atts['images_per_page'])) {
455 $ufg_images_per_page = $atts['images_per_page']; //shortcode
456 } else {
457 if (isset($ufg_setting['images_per_page'])) {
458 $ufg_images_per_page = $ufg_setting['images_per_page']; //saved
459 } else {
460 $ufg_images_per_page = 16; // default
461 }
462 }
463
464 if (isset($atts['load_more'])) {
465 $ufg_load_more = $atts['load_more']; //shortcode
466 } else {
467 if (isset($ufg_setting['load_more'])) {
468 $ufg_load_more = $ufg_setting['load_more']; //saved
469 } else {
470 $ufg_load_more = 1; // default
471 }
472 }
473
474 if (isset($atts['load_more_button_text'])) {
475 $ufg_load_more_button_text = $atts['load_more_button_text']; //shortcode
476 } else {
477 if (isset($ufg_setting['load_more_button_text'])) {
478 $ufg_load_more_button_text = $ufg_setting['load_more_button_text']; //saved
479 } else {
480 $ufg_load_more_button_text = __('Load More', 'filter-gallery'); // default
481 }
482 }
483
484 if (isset($atts['load_more_button_color'])) {
485 $ufg_load_more_button_color = $atts['load_more_button_color']; //shortcode
486 } else {
487 if (isset($ufg_setting['load_more_button_color']) && $ufg_setting['load_more_button_color'] !== '') {
488 $ufg_load_more_button_color = $ufg_setting['load_more_button_color']; //saved
489 } else {
490 $ufg_load_more_button_color = "#FFFFFF"; // default
491 }
492 }
493
494 if (isset($atts['load_more_images_per_call'])) {
495 $ufg_load_more_images_per_call = $atts['load_more_images_per_call']; //shortcode
496 } else {
497 if (isset($ufg_setting['load_more_images_per_call']) && $ufg_setting['load_more_images_per_call'] !== '') {
498 $ufg_load_more_images_per_call = $ufg_setting['load_more_images_per_call']; //saved
499 } else {
500 $ufg_load_more_images_per_call = 8; // default (was 4)
501 }
502 }
503
504 if (isset($atts['image_sorting'])) {
505 $ufg_image_sorting = $atts['image_sorting']; //shortcode
506 } else {
507 if (isset($ufg_setting['image_sorting'])) {
508 $ufg_image_sorting = $ufg_setting['image_sorting']; //saved
509 } else {
510 $ufg_image_sorting = 5; // default None/Manual
511 }
512 }
513 if (!in_array((string)$ufg_image_sorting, array('5', '1', '2'), true)) {
514 $ufg_image_sorting = 5;
515 }
516
517 if (isset($atts['image_search'])) {
518 $ufg_image_search = $atts['image_search']; //shortcode
519 } else {
520 if (isset($ufg_setting['image_search'])) {
521 $ufg_image_search = $ufg_setting['image_search']; //saved
522 } else {
523 $ufg_image_search = 1; // default
524 }
525 }
526
527 if (isset($atts['lightbox'])) {
528 $ufg_lightbox = $atts['lightbox']; //shortcode
529 } else {
530 if (isset($ufg_setting['lightbox']) && $ufg_setting['lightbox'] !== '') {
531 $ufg_lightbox = $ufg_setting['lightbox']; //saved
532 } else {
533 $ufg_lightbox = 1; // default
534 }
535 }
536
537 if (isset($atts['lightbox_title'])) {
538 $ufg_lightbox_title = $atts['lightbox_title']; //shortcode
539 } else {
540 if (isset($ufg_setting['lightbox_title']) && $ufg_setting['lightbox_title'] !== '') {
541 $ufg_lightbox_title = $ufg_setting['lightbox_title']; //saved
542 } else {
543 $ufg_lightbox_title = 1; // default
544 }
545 }
546
547 $ufg_lightbox_description = 0;
548 $ufg_lightbox_numbering = 0;
549
550 $ufg_custom_css = "";
551
552 $load_more = "off";
553 $ufg_load_more = "off";
554
555 if (isset($atts['load_limit'])) {
556 $load_limit = $atts['load_limit']; //shortcode
557 } else {
558 if (isset($ufg_setting['load_limit']) && $ufg_setting['load_limit'] !== '') {
559 $load_limit = $ufg_setting['load_limit']; //saved
560 } elseif (isset($ufg_setting['load_more_images_per_call']) && $ufg_setting['load_more_images_per_call'] !== '') {
561 $load_limit = $ufg_setting['load_more_images_per_call']; //fallback to free
562 } else {
563 $load_limit = 10; // default
564 }
565 }
566 if (isset($atts['load_color'])) {
567 $load_color = $atts['load_color']; //shortcode
568 } else {
569 if (isset($ufg_setting['load_color']) && $ufg_setting['load_color'] !== '') {
570 $load_color = $ufg_setting['load_color']; //saved
571 } elseif (isset($ufg_setting['load_more_button_color']) && $ufg_setting['load_more_button_color'] !== '') {
572 $load_color = $ufg_setting['load_more_button_color']; //fallback to free
573 } else {
574 $load_color = '#0080ff'; // default
575 }
576 }
577 if (isset($atts['load_txt_color'])) {
578 $load_txt_color = $atts['load_txt_color']; //shortcode
579 } else {
580 if (isset($ufg_setting['load_txt_color']) && $ufg_setting['load_txt_color'] !== '') {
581 $load_txt_color = $ufg_setting['load_txt_color']; //saved
582 } else {
583 $load_txt_color = '#FFFFFF'; // default
584 }
585 }
586 if (isset($atts['load_btn_txt'])) {
587 $load_btn_txt = $atts['load_btn_txt']; //shortcode
588 } else {
589 if (isset($ufg_setting['load_btn_txt'])) {
590 $load_btn_txt = $ufg_setting['load_btn_txt']; //saved
591 } elseif (isset($ufg_setting['load_more_button_text'])) {
592 $load_btn_txt = $ufg_setting['load_more_button_text']; //fallback to free
593 } else {
594 $load_btn_txt = 'Load More'; // default
595 }
596 }
597 // Custom advanced settings
598 $ufg_filter_style = isset($atts['filter_style']) ? $atts['filter_style'] : (isset($ufg_setting['filter_style']) ? $ufg_setting['filter_style'] : 'buttons');
599 if ($ufg_filter_style !== 'dropdown') {
600 $ufg_filter_style = 'buttons';
601 }
602 $ufg_combine_filter_search = '0';
603 $ufg_filter_padding = isset($atts['filter_padding']) ? $atts['filter_padding'] : (isset($ufg_setting['filter_padding']) ? $ufg_setting['filter_padding'] : '8px 16px');
604 $ufg_filter_margin = isset($atts['filter_margin']) ? $atts['filter_margin'] : (isset($ufg_setting['filter_margin']) ? $ufg_setting['filter_margin'] : '5px');
605
606 // Level 1-6 colors mapping with pastel defaults
607 $levels_mapping = array(
608 'parent' => array(
609 'hover' => '#000000',
610 'active_txt' => '#FFFFFF',
611 'active_bg' => '#4F46E5'
612 ),
613 'l1' => array(
614 'hover' => '#4338CA',
615 'active_txt' => '#FFFFFF',
616 'active_bg' => '#4F46E5'
617 ),
618 'l2' => array(
619 'hover' => '#4338CA',
620 'active_txt' => '#FFFFFF',
621 'active_bg' => '#4F46E5'
622 ),
623 'l3' => array(
624 'hover' => '#4338CA',
625 'active_txt' => '#FFFFFF',
626 'active_bg' => '#4F46E5'
627 ),
628 'l4' => array(
629 'hover' => '#4338CA',
630 'active_txt' => '#FFFFFF',
631 'active_bg' => '#4F46E5'
632 )
633 );
634 $ufg_custom_colors = array();
635 foreach ($levels_mapping as $suffix => $defaults) {
636 $key_hover = "{$suffix}_button_hover_color";
637 $ufg_custom_colors[$key_hover] = isset($atts[$key_hover]) ? $atts[$key_hover] : (isset($ufg_setting[$key_hover]) ? $ufg_setting[$key_hover] : $defaults['hover']);
638
639 $key_act_txt = "{$suffix}_active_button_color";
640 $ufg_custom_colors[$key_act_txt] = isset($atts[$key_act_txt]) ? $atts[$key_act_txt] : (isset($ufg_setting[$key_act_txt]) ? $ufg_setting[$key_act_txt] : $defaults['active_txt']);
641
642 $key_act_bg = "{$suffix}_active_button_bg_color";
643 $ufg_custom_colors[$key_act_bg] = isset($atts[$key_act_bg]) ? $atts[$key_act_bg] : (isset($ufg_setting[$key_act_bg]) ? $ufg_setting[$key_act_bg] : $defaults['active_bg']);
644 }
645 extract($ufg_custom_colors);
646 ?>