Galleries by Angie Makes - Version 1.53

Version Description

Download this release

Release Info

Developer cbaldelomar
Plugin Icon wp plugin Galleries by Angie Makes
Version 1.53
Comparing to
See all releases

Code changes from version 1.52 to 1.53

README.md CHANGED
@@ -62,6 +62,10 @@ For more tutorials on our gallery plugin, go to our knowledge base.
62
 
63
  ## Changelog ##
64
 
 
 
 
 
65
  ### Version 1.52 ###
66
 
67
  * updated owl carousel 2.1.4
62
 
63
  ## Changelog ##
64
 
65
+ ### Version 1.53 ###
66
+
67
+ * updated wpc settings framework to version 1.0.2
68
+
69
  ### Version 1.52 ###
70
 
71
  * updated owl carousel 2.1.4
includes/functions.php CHANGED
@@ -633,7 +633,7 @@ function wc_gallery_attachment_fields_to_edit( $form_fields, $post) {
633
  "label" => __( "Link To" ),
634
  "input" => "text",
635
  "value" => get_post_meta( $post->ID, _WC_GALLERY_PREFIX . "custom_image_link", true )
636
- );
637
  return $form_fields;
638
  }
639
  add_filter( "attachment_fields_to_edit", "wc_gallery_attachment_fields_to_edit", null, 2 );
633
  "label" => __( "Link To" ),
634
  "input" => "text",
635
  "value" => get_post_meta( $post->ID, _WC_GALLERY_PREFIX . "custom_image_link", true )
636
+ );
637
  return $form_fields;
638
  }
639
  add_filter( "attachment_fields_to_edit", "wc_gallery_attachment_fields_to_edit", null, 2 );
includes/options.php CHANGED
@@ -33,6 +33,7 @@ function wc_gallery_options( $options ) {
33
  'label' => 'Max Width',
34
  'default' => $wc_gallery_theme_support['icon']['size_w'],
35
  'type' => 'positive_number',
 
36
  ),
37
  array(
38
  'option_name' => 'icon_size_h',
@@ -40,6 +41,7 @@ function wc_gallery_options( $options ) {
40
  'default' => $wc_gallery_theme_support['icon']['size_h'],
41
  'type' => 'positive_number',
42
  'newline' => true,
 
43
  ),
44
  array(
45
  'option_name' => 'icon_crop',
@@ -48,6 +50,7 @@ function wc_gallery_options( $options ) {
48
  'description' => '',
49
  'type' => 'checkbox',
50
  'newline' => true,
 
51
  ),
52
  array(
53
  'option_name' => 'icon_enable',
@@ -55,6 +58,7 @@ function wc_gallery_options( $options ) {
55
  'default' => $wc_gallery_theme_support['icon']['enable'],
56
  'description' => '',
57
  'type' => 'checkbox',
 
58
  ),
59
  ),
60
  ),
@@ -69,6 +73,7 @@ function wc_gallery_options( $options ) {
69
  'default' => $wc_gallery_theme_support['square']['size_w'],
70
  'type' => 'positive_number',
71
  'less' => true,
 
72
  ),
73
  array(
74
  'option_name' => 'square_size_h',
@@ -77,6 +82,7 @@ function wc_gallery_options( $options ) {
77
  'type' => 'positive_number',
78
  'less' => true,
79
  'newline' => true,
 
80
  ),
81
  array(
82
  'option_name' => 'square_crop',
@@ -85,6 +91,7 @@ function wc_gallery_options( $options ) {
85
  'description' => '',
86
  'type' => 'checkbox',
87
  'newline' => true,
 
88
  ),
89
  array(
90
  'option_name' => 'square_enable',
@@ -92,6 +99,7 @@ function wc_gallery_options( $options ) {
92
  'default' => $wc_gallery_theme_support['square']['enable'],
93
  'description' => '',
94
  'type' => 'checkbox',
 
95
  ),
96
  ),
97
  ),
@@ -105,6 +113,7 @@ function wc_gallery_options( $options ) {
105
  'label' => 'Max Width',
106
  'default' => $wc_gallery_theme_support['small']['size_w'],
107
  'type' => 'positive_number',
 
108
  ),
109
  array(
110
  'option_name' => 'small_size_h',
@@ -112,6 +121,7 @@ function wc_gallery_options( $options ) {
112
  'default' => $wc_gallery_theme_support['small']['size_h'],
113
  'type' => 'positive_number',
114
  'newline' => true,
 
115
  ),
116
  array(
117
  'option_name' => 'small_enable',
@@ -119,6 +129,7 @@ function wc_gallery_options( $options ) {
119
  'default' => $wc_gallery_theme_support['small']['enable'],
120
  'description' => '',
121
  'type' => 'checkbox',
 
122
  ),
123
  ),
124
  ),
@@ -132,6 +143,7 @@ function wc_gallery_options( $options ) {
132
  'label' => 'Max Width',
133
  'default' => $wc_gallery_theme_support['standard']['size_w'],
134
  'type' => 'positive_number',
 
135
  ),
136
  array(
137
  'option_name' => 'standard_size_h',
@@ -139,6 +151,7 @@ function wc_gallery_options( $options ) {
139
  'default' => $wc_gallery_theme_support['standard']['size_h'],
140
  'type' => 'positive_number',
141
  'newline' => true,
 
142
  ),
143
  array(
144
  'option_name' => 'standard_enable',
@@ -146,6 +159,7 @@ function wc_gallery_options( $options ) {
146
  'default' => $wc_gallery_theme_support['standard']['enable'],
147
  'description' => '',
148
  'type' => 'checkbox',
 
149
  ),
150
  ),
151
  ),
@@ -159,6 +173,7 @@ function wc_gallery_options( $options ) {
159
  'label' => 'Max Width',
160
  'default' => $wc_gallery_theme_support['big']['size_w'],
161
  'type' => 'positive_number',
 
162
  ),
163
  array(
164
  'option_name' => 'big_size_h',
@@ -166,6 +181,7 @@ function wc_gallery_options( $options ) {
166
  'default' => $wc_gallery_theme_support['big']['size_h'],
167
  'type' => 'positive_number',
168
  'newline' => true,
 
169
  ),
170
  array(
171
  'option_name' => 'big_enable',
@@ -173,6 +189,7 @@ function wc_gallery_options( $options ) {
173
  'default' => $wc_gallery_theme_support['big']['enable'],
174
  'description' => '',
175
  'type' => 'checkbox',
 
176
  ),
177
  ),
178
  ),
@@ -186,6 +203,7 @@ function wc_gallery_options( $options ) {
186
  'label' => 'Max Width',
187
  'default' => $wc_gallery_theme_support['fixedheightsmall']['size_w'],
188
  'type' => 'positive_number',
 
189
  ),
190
  array(
191
  'option_name' => 'fixedheightsmall_size_h',
@@ -193,6 +211,7 @@ function wc_gallery_options( $options ) {
193
  'default' => $wc_gallery_theme_support['fixedheightsmall']['size_h'],
194
  'type' => 'positive_number',
195
  'newline' => true,
 
196
  ),
197
  array(
198
  'option_name' => 'fixedheightsmall_enable',
@@ -200,6 +219,7 @@ function wc_gallery_options( $options ) {
200
  'default' => $wc_gallery_theme_support['fixedheightsmall']['enable'],
201
  'description' => '',
202
  'type' => 'checkbox',
 
203
  ),
204
  ),
205
  ),
@@ -213,6 +233,7 @@ function wc_gallery_options( $options ) {
213
  'label' => 'Max Width',
214
  'default' => $wc_gallery_theme_support['fixedheightmedium']['size_w'],
215
  'type' => 'positive_number',
 
216
  ),
217
  array(
218
  'option_name' => 'fixedheightmedium_size_h',
@@ -220,6 +241,7 @@ function wc_gallery_options( $options ) {
220
  'default' => $wc_gallery_theme_support['fixedheightmedium']['size_h'],
221
  'type' => 'positive_number',
222
  'newline' => true,
 
223
  ),
224
  array(
225
  'option_name' => 'fixedheightmedium_enable',
@@ -227,6 +249,7 @@ function wc_gallery_options( $options ) {
227
  'default' => $wc_gallery_theme_support['fixedheightmedium']['enable'],
228
  'description' => '',
229
  'type' => 'checkbox',
 
230
  ),
231
  ),
232
  ),
@@ -240,6 +263,7 @@ function wc_gallery_options( $options ) {
240
  'label' => 'Max Width',
241
  'default' => $wc_gallery_theme_support['fixedheight']['size_w'],
242
  'type' => 'positive_number',
 
243
  ),
244
  array(
245
  'option_name' => 'fixedheight_size_h',
@@ -247,6 +271,7 @@ function wc_gallery_options( $options ) {
247
  'default' => $wc_gallery_theme_support['fixedheight']['size_h'],
248
  'type' => 'positive_number',
249
  'newline' => true,
 
250
  ),
251
  array(
252
  'option_name' => 'fixedheight_enable',
@@ -254,6 +279,7 @@ function wc_gallery_options( $options ) {
254
  'default' => $wc_gallery_theme_support['fixedheight']['enable'],
255
  'description' => '',
256
  'type' => 'checkbox',
 
257
  ),
258
  ),
259
  ),
@@ -267,6 +293,7 @@ function wc_gallery_options( $options ) {
267
  'label' => 'Max Width',
268
  'default' => $wc_gallery_theme_support['carouselsmall']['size_w'],
269
  'type' => 'positive_number',
 
270
  ),
271
  array(
272
  'option_name' => 'carouselsmall_size_h',
@@ -274,6 +301,7 @@ function wc_gallery_options( $options ) {
274
  'default' => $wc_gallery_theme_support['carouselsmall']['size_h'],
275
  'type' => 'positive_number',
276
  'newline' => true,
 
277
  ),
278
  array(
279
  'option_name' => 'carouselsmall_crop',
@@ -282,6 +310,7 @@ function wc_gallery_options( $options ) {
282
  'description' => '',
283
  'type' => 'checkbox',
284
  'newline' => true,
 
285
  ),
286
  array(
287
  'option_name' => 'carouselsmall_enable',
@@ -289,6 +318,7 @@ function wc_gallery_options( $options ) {
289
  'default' => $wc_gallery_theme_support['carouselsmall']['enable'],
290
  'description' => '',
291
  'type' => 'checkbox',
 
292
  ),
293
  ),
294
  ),
@@ -302,6 +332,7 @@ function wc_gallery_options( $options ) {
302
  'label' => 'Max Width',
303
  'default' => $wc_gallery_theme_support['carousel']['size_w'],
304
  'type' => 'positive_number',
 
305
  ),
306
  array(
307
  'option_name' => 'carousel_size_h',
@@ -309,6 +340,7 @@ function wc_gallery_options( $options ) {
309
  'default' => $wc_gallery_theme_support['carousel']['size_h'],
310
  'type' => 'positive_number',
311
  'newline' => true,
 
312
  ),
313
  array(
314
  'option_name' => 'carousel_crop',
@@ -317,6 +349,7 @@ function wc_gallery_options( $options ) {
317
  'description' => '',
318
  'type' => 'checkbox',
319
  'newline' => true,
 
320
  ),
321
  array(
322
  'option_name' => 'carousel_enable',
@@ -324,6 +357,7 @@ function wc_gallery_options( $options ) {
324
  'default' => $wc_gallery_theme_support['carousel']['enable'],
325
  'description' => '',
326
  'type' => 'checkbox',
 
327
  ),
328
  ),
329
  ),
@@ -337,6 +371,7 @@ function wc_gallery_options( $options ) {
337
  'label' => 'Max Width',
338
  'default' => $wc_gallery_theme_support['slider']['size_w'],
339
  'type' => 'positive_number',
 
340
  ),
341
  array(
342
  'option_name' => 'slider_size_h',
@@ -344,6 +379,7 @@ function wc_gallery_options( $options ) {
344
  'default' => $wc_gallery_theme_support['slider']['size_h'],
345
  'type' => 'positive_number',
346
  'newline' => true,
 
347
  ),
348
  array(
349
  'option_name' => 'slider_crop',
@@ -352,6 +388,7 @@ function wc_gallery_options( $options ) {
352
  'description' => '',
353
  'type' => 'checkbox',
354
  'newline' => true,
 
355
  ),
356
  array(
357
  'option_name' => 'slider_enable',
@@ -359,6 +396,7 @@ function wc_gallery_options( $options ) {
359
  'default' => $wc_gallery_theme_support['slider']['enable'],
360
  'description' => '',
361
  'type' => 'checkbox',
 
362
  ),
363
  ),
364
  ),
@@ -382,6 +420,7 @@ function wc_gallery_options( $options ) {
382
  'description' => '',
383
  'label' => 'Use gallery CSS provided by plugin',
384
  'type' => 'checkbox',
 
385
  ),
386
  array(
387
  'option_name' => 'enable_image_popup',
@@ -390,6 +429,7 @@ function wc_gallery_options( $options ) {
390
  'description' => '',
391
  'label' => 'Use <a target="_blank" href="http://dimsemenov.com/plugins/magnific-popup/">Magnific Popup</a> to showcase your images?',
392
  'type' => 'checkbox',
 
393
  ),
394
  ),
395
  ),
@@ -401,3 +441,10 @@ function wc_gallery_options( $options ) {
401
  return $options;
402
  }
403
  add_filter( 'wc_gallery_wpcsf_options', 'wc_gallery_options', 10, 1 );
 
 
 
 
 
 
 
33
  'label' => 'Max Width',
34
  'default' => $wc_gallery_theme_support['icon']['size_w'],
35
  'type' => 'positive_number',
36
+ 'theme_reset' => true,
37
  ),
38
  array(
39
  'option_name' => 'icon_size_h',
41
  'default' => $wc_gallery_theme_support['icon']['size_h'],
42
  'type' => 'positive_number',
43
  'newline' => true,
44
+ 'theme_reset' => true,
45
  ),
46
  array(
47
  'option_name' => 'icon_crop',
50
  'description' => '',
51
  'type' => 'checkbox',
52
  'newline' => true,
53
+ 'theme_reset' => true,
54
  ),
55
  array(
56
  'option_name' => 'icon_enable',
58
  'default' => $wc_gallery_theme_support['icon']['enable'],
59
  'description' => '',
60
  'type' => 'checkbox',
61
+ 'theme_reset' => true,
62
  ),
63
  ),
64
  ),
73
  'default' => $wc_gallery_theme_support['square']['size_w'],
74
  'type' => 'positive_number',
75
  'less' => true,
76
+ 'theme_reset' => true,
77
  ),
78
  array(
79
  'option_name' => 'square_size_h',
82
  'type' => 'positive_number',
83
  'less' => true,
84
  'newline' => true,
85
+ 'theme_reset' => true,
86
  ),
87
  array(
88
  'option_name' => 'square_crop',
91
  'description' => '',
92
  'type' => 'checkbox',
93
  'newline' => true,
94
+ 'theme_reset' => true,
95
  ),
96
  array(
97
  'option_name' => 'square_enable',
99
  'default' => $wc_gallery_theme_support['square']['enable'],
100
  'description' => '',
101
  'type' => 'checkbox',
102
+ 'theme_reset' => true,
103
  ),
104
  ),
105
  ),
113
  'label' => 'Max Width',
114
  'default' => $wc_gallery_theme_support['small']['size_w'],
115
  'type' => 'positive_number',
116
+ 'theme_reset' => true,
117
  ),
118
  array(
119
  'option_name' => 'small_size_h',
121
  'default' => $wc_gallery_theme_support['small']['size_h'],
122
  'type' => 'positive_number',
123
  'newline' => true,
124
+ 'theme_reset' => true,
125
  ),
126
  array(
127
  'option_name' => 'small_enable',
129
  'default' => $wc_gallery_theme_support['small']['enable'],
130
  'description' => '',
131
  'type' => 'checkbox',
132
+ 'theme_reset' => true,
133
  ),
134
  ),
135
  ),
143
  'label' => 'Max Width',
144
  'default' => $wc_gallery_theme_support['standard']['size_w'],
145
  'type' => 'positive_number',
146
+ 'theme_reset' => true,
147
  ),
148
  array(
149
  'option_name' => 'standard_size_h',
151
  'default' => $wc_gallery_theme_support['standard']['size_h'],
152
  'type' => 'positive_number',
153
  'newline' => true,
154
+ 'theme_reset' => true,
155
  ),
156
  array(
157
  'option_name' => 'standard_enable',
159
  'default' => $wc_gallery_theme_support['standard']['enable'],
160
  'description' => '',
161
  'type' => 'checkbox',
162
+ 'theme_reset' => true,
163
  ),
164
  ),
165
  ),
173
  'label' => 'Max Width',
174
  'default' => $wc_gallery_theme_support['big']['size_w'],
175
  'type' => 'positive_number',
176
+ 'theme_reset' => true,
177
  ),
178
  array(
179
  'option_name' => 'big_size_h',
181
  'default' => $wc_gallery_theme_support['big']['size_h'],
182
  'type' => 'positive_number',
183
  'newline' => true,
184
+ 'theme_reset' => true,
185
  ),
186
  array(
187
  'option_name' => 'big_enable',
189
  'default' => $wc_gallery_theme_support['big']['enable'],
190
  'description' => '',
191
  'type' => 'checkbox',
192
+ 'theme_reset' => true,
193
  ),
194
  ),
195
  ),
203
  'label' => 'Max Width',
204
  'default' => $wc_gallery_theme_support['fixedheightsmall']['size_w'],
205
  'type' => 'positive_number',
206
+ 'theme_reset' => true,
207
  ),
208
  array(
209
  'option_name' => 'fixedheightsmall_size_h',
211
  'default' => $wc_gallery_theme_support['fixedheightsmall']['size_h'],
212
  'type' => 'positive_number',
213
  'newline' => true,
214
+ 'theme_reset' => true,
215
  ),
216
  array(
217
  'option_name' => 'fixedheightsmall_enable',
219
  'default' => $wc_gallery_theme_support['fixedheightsmall']['enable'],
220
  'description' => '',
221
  'type' => 'checkbox',
222
+ 'theme_reset' => true,
223
  ),
224
  ),
225
  ),
233
  'label' => 'Max Width',
234
  'default' => $wc_gallery_theme_support['fixedheightmedium']['size_w'],
235
  'type' => 'positive_number',
236
+ 'theme_reset' => true,
237
  ),
238
  array(
239
  'option_name' => 'fixedheightmedium_size_h',
241
  'default' => $wc_gallery_theme_support['fixedheightmedium']['size_h'],
242
  'type' => 'positive_number',
243
  'newline' => true,
244
+ 'theme_reset' => true,
245
  ),
246
  array(
247
  'option_name' => 'fixedheightmedium_enable',
249
  'default' => $wc_gallery_theme_support['fixedheightmedium']['enable'],
250
  'description' => '',
251
  'type' => 'checkbox',
252
+ 'theme_reset' => true,
253
  ),
254
  ),
255
  ),
263
  'label' => 'Max Width',
264
  'default' => $wc_gallery_theme_support['fixedheight']['size_w'],
265
  'type' => 'positive_number',
266
+ 'theme_reset' => true,
267
  ),
268
  array(
269
  'option_name' => 'fixedheight_size_h',
271
  'default' => $wc_gallery_theme_support['fixedheight']['size_h'],
272
  'type' => 'positive_number',
273
  'newline' => true,
274
+ 'theme_reset' => true,
275
  ),
276
  array(
277
  'option_name' => 'fixedheight_enable',
279
  'default' => $wc_gallery_theme_support['fixedheight']['enable'],
280
  'description' => '',
281
  'type' => 'checkbox',
282
+ 'theme_reset' => true,
283
  ),
284
  ),
285
  ),
293
  'label' => 'Max Width',
294
  'default' => $wc_gallery_theme_support['carouselsmall']['size_w'],
295
  'type' => 'positive_number',
296
+ 'theme_reset' => true,
297
  ),
298
  array(
299
  'option_name' => 'carouselsmall_size_h',
301
  'default' => $wc_gallery_theme_support['carouselsmall']['size_h'],
302
  'type' => 'positive_number',
303
  'newline' => true,
304
+ 'theme_reset' => true,
305
  ),
306
  array(
307
  'option_name' => 'carouselsmall_crop',
310
  'description' => '',
311
  'type' => 'checkbox',
312
  'newline' => true,
313
+ 'theme_reset' => true,
314
  ),
315
  array(
316
  'option_name' => 'carouselsmall_enable',
318
  'default' => $wc_gallery_theme_support['carouselsmall']['enable'],
319
  'description' => '',
320
  'type' => 'checkbox',
321
+ 'theme_reset' => true,
322
  ),
323
  ),
324
  ),
332
  'label' => 'Max Width',
333
  'default' => $wc_gallery_theme_support['carousel']['size_w'],
334
  'type' => 'positive_number',
335
+ 'theme_reset' => true,
336
  ),
337
  array(
338
  'option_name' => 'carousel_size_h',
340
  'default' => $wc_gallery_theme_support['carousel']['size_h'],
341
  'type' => 'positive_number',
342
  'newline' => true,
343
+ 'theme_reset' => true,
344
  ),
345
  array(
346
  'option_name' => 'carousel_crop',
349
  'description' => '',
350
  'type' => 'checkbox',
351
  'newline' => true,
352
+ 'theme_reset' => true,
353
  ),
354
  array(
355
  'option_name' => 'carousel_enable',
357
  'default' => $wc_gallery_theme_support['carousel']['enable'],
358
  'description' => '',
359
  'type' => 'checkbox',
360
+ 'theme_reset' => true,
361
  ),
362
  ),
363
  ),
371
  'label' => 'Max Width',
372
  'default' => $wc_gallery_theme_support['slider']['size_w'],
373
  'type' => 'positive_number',
374
+ 'theme_reset' => true,
375
  ),
376
  array(
377
  'option_name' => 'slider_size_h',
379
  'default' => $wc_gallery_theme_support['slider']['size_h'],
380
  'type' => 'positive_number',
381
  'newline' => true,
382
+ 'theme_reset' => true,
383
  ),
384
  array(
385
  'option_name' => 'slider_crop',
388
  'description' => '',
389
  'type' => 'checkbox',
390
  'newline' => true,
391
+ 'theme_reset' => true,
392
  ),
393
  array(
394
  'option_name' => 'slider_enable',
396
  'default' => $wc_gallery_theme_support['slider']['enable'],
397
  'description' => '',
398
  'type' => 'checkbox',
399
+ 'theme_reset' => true,
400
  ),
401
  ),
402
  ),
420
  'description' => '',
421
  'label' => 'Use gallery CSS provided by plugin',
422
  'type' => 'checkbox',
423
+ 'theme_reset' => true,
424
  ),
425
  array(
426
  'option_name' => 'enable_image_popup',
429
  'description' => '',
430
  'label' => 'Use <a target="_blank" href="http://dimsemenov.com/plugins/magnific-popup/">Magnific Popup</a> to showcase your images?',
431
  'type' => 'checkbox',
432
+ 'theme_reset' => true,
433
  ),
434
  ),
435
  ),
441
  return $options;
442
  }
443
  add_filter( 'wc_gallery_wpcsf_options', 'wc_gallery_options', 10, 1 );
444
+
445
+ function wc_gallery_theme_support() {
446
+ global $wc_gallery_theme_support;
447
+
448
+ return $wc_gallery_theme_support;
449
+ }
450
+ add_filter( 'wc_gallery_wpcsf_theme_support', 'wc_gallery_theme_support', 10, 1 );
includes/vendors/wpc-settings-framework/class-wpc-settings-framework.php CHANGED
@@ -17,7 +17,7 @@
17
  */
18
  class WC_Gallery_Settings_Framework {
19
 
20
- protected $version = '1.0.0';
21
 
22
  /**
23
  * Instance of this class.
@@ -52,6 +52,7 @@ class WC_Gallery_Settings_Framework {
52
  protected $plugin_prefix = null;
53
  protected $plugin_version = 0;
54
  protected $options = array();
 
55
  protected $wp_settings_tabs = array();
56
  protected $tabs = array();
57
 
@@ -71,6 +72,8 @@ class WC_Gallery_Settings_Framework {
71
  add_action( 'init', array( $this, 'set_options' ), 100 );
72
  add_action( 'admin_init', array( $this, 'register_settings' ) );
73
  add_action( 'admin_init', array( $this, 'options_activation' ), 200 );
 
 
74
  add_action( 'admin_menu', array( $this, 'options_admin_menu' ) );
75
 
76
  // Load admin style sheet and JavaScript.
@@ -118,22 +121,13 @@ class WC_Gallery_Settings_Framework {
118
 
119
  public function set_options() {
120
  $this->options = apply_filters ( $this->plugin_prefix . 'wpcsf_options' , $this->options );
 
121
  }
122
 
123
- public function options_activation() {
124
-
125
- $initialize = false;
126
-
127
- if ( ! isset( $this->plugin_current_version ) || empty( $this->plugin_current_version ) ) {
128
- $initialize = true;
129
- }
130
- else if ( version_compare( $this->plugin_version, $this->plugin_current_version ) > 0 ) {
131
- $initialize = true;
132
- }
133
-
134
- if ( $initialize ) {
135
- update_option( $this->plugin_prefix . 'current_version', $this->plugin_version );
136
 
 
137
  foreach ( $this->options as $menu_slug => $o ) {
138
  if ( isset( $o['option_group'] ) ) {
139
  if ( isset( $o['tabs'] ) &&
@@ -141,18 +135,91 @@ class WC_Gallery_Settings_Framework {
141
  foreach( $o['tabs'] as $key => $oo ) {
142
  if ( isset( $oo['sections'] ) &&
143
  is_array( $oo['sections'] ) ) {
144
- $this->loop_and_init_options( $oo['sections'] );
145
  }
146
  }
147
  }
148
  else if ( isset( $o['sections'] ) &&
149
  is_array( $o['sections'] ) ) {
150
- $this->loop_and_init_options( $o['sections'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  }
152
  }
153
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  }
155
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
 
157
  public function loop_and_init_options( $sections ) {
158
  foreach( $sections as $o ) {
@@ -233,6 +300,9 @@ class WC_Gallery_Settings_Framework {
233
  if ( isset( $oo['group'] ) && is_array( $oo['group'] ) ) {
234
  foreach ( $oo['group'] as $key => $ooo ) {
235
  if ( isset( $ooo['option_name'] ) ) {
 
 
 
236
  $ooo['option_name'] = $this->plugin_prefix . $ooo['option_name'];
237
  $oo['group'][ $key ]['option_name'] = $ooo['option_name'];
238
 
@@ -251,6 +321,9 @@ class WC_Gallery_Settings_Framework {
251
  }
252
  else {
253
  if ( isset( $oo['option_name'] ) ) {
 
 
 
254
  $oo['option_name'] = $this->plugin_prefix . $oo['option_name'];
255
 
256
  $callback = $this->get_callback( $oo );
17
  */
18
  class WC_Gallery_Settings_Framework {
19
 
20
+ protected $version = '1.0.2';
21
 
22
  /**
23
  * Instance of this class.
52
  protected $plugin_prefix = null;
53
  protected $plugin_version = 0;
54
  protected $options = array();
55
+ protected $theme_support = array();
56
  protected $wp_settings_tabs = array();
57
  protected $tabs = array();
58
 
72
  add_action( 'init', array( $this, 'set_options' ), 100 );
73
  add_action( 'admin_init', array( $this, 'register_settings' ) );
74
  add_action( 'admin_init', array( $this, 'options_activation' ), 200 );
75
+ // add_action( 'admin_init', array( $this, 'update_options' ), 200 ); // debug
76
+ add_action( 'after_switch_theme', array( $this, 'update_options' ), 200 );
77
  add_action( 'admin_menu', array( $this, 'options_admin_menu' ) );
78
 
79
  // Load admin style sheet and JavaScript.
121
 
122
  public function set_options() {
123
  $this->options = apply_filters ( $this->plugin_prefix . 'wpcsf_options' , $this->options );
124
+ $this->theme_support = apply_filters ( $this->plugin_prefix . 'wpcsf_theme_support' , $this->theme_support );
125
  }
126
 
127
+ public function update_options() {
128
+ $this->set_options();
 
 
 
 
 
 
 
 
 
 
 
129
 
130
+ if ( isset( $this->theme_support['theme_reset'] ) && $this->theme_support['theme_reset'] ) {
131
  foreach ( $this->options as $menu_slug => $o ) {
132
  if ( isset( $o['option_group'] ) ) {
133
  if ( isset( $o['tabs'] ) &&
135
  foreach( $o['tabs'] as $key => $oo ) {
136
  if ( isset( $oo['sections'] ) &&
137
  is_array( $oo['sections'] ) ) {
138
+ $this->loop_and_update_options( $oo['sections'] );
139
  }
140
  }
141
  }
142
  else if ( isset( $o['sections'] ) &&
143
  is_array( $o['sections'] ) ) {
144
+ $this->loop_and_update_options( $o['sections'] );
145
+ }
146
+ }
147
+ }
148
+ }
149
+
150
+ }
151
+
152
+ public function loop_and_update_options( $sections ) {
153
+ foreach( $sections as $o ) {
154
+ if ( isset( $o['id'] ) &&
155
+ isset( $o['title'] ) &&
156
+ isset( $o['options'] ) &&
157
+ is_array( $o['options'] ) ) {
158
+ foreach( $o['options'] as $oo ) {
159
+ if ( isset( $oo['group'] ) && is_array( $oo['group'] ) ) {
160
+ foreach ( $oo['group'] as $key => $ooo ) {
161
+ if ( isset( $ooo['option_name'] ) ) {
162
+ if ( isset( $ooo['theme_reset'] ) && $ooo['theme_reset'] ) {
163
+ $ooo['option_name'] = $this->plugin_prefix . $ooo['option_name'];
164
+ $this->update_option( $ooo['option_name'], $ooo['default'] );
165
+ }
166
+ }
167
+ }
168
+ }
169
+ else {
170
+ if ( isset( $oo['option_name'] ) ) {
171
+ if ( isset( $oo['theme_reset'] ) && $oo['theme_reset'] ) {
172
+ $oo['option_name'] = $this->plugin_prefix . $oo['option_name'];
173
+ $this->update_option( $oo['option_name'], $oo['default'] );
174
+ }
175
+ }
176
  }
177
  }
178
  }
179
+ }
180
+ }
181
+
182
+ public function update_option( $option_name, $default ) {
183
+ update_option( $option_name, $default );
184
+ }
185
+
186
+ public function options_activation() {
187
+
188
+ $initialize = false;
189
+
190
+ if ( ! isset( $this->plugin_current_version ) || empty( $this->plugin_current_version ) ) {
191
+ $initialize = true;
192
+ }
193
+ else if ( version_compare( $this->plugin_version, $this->plugin_current_version ) > 0 ) {
194
+ $initialize = true;
195
+ }
196
+
197
+ if ( $initialize ) {
198
+ $this->options_activation_loop();
199
  }
200
  }
201
+
202
+ public function options_activation_loop() {
203
+ update_option( $this->plugin_prefix . 'current_version', $this->plugin_version );
204
+
205
+ foreach ( $this->options as $menu_slug => $o ) {
206
+ if ( isset( $o['option_group'] ) ) {
207
+ if ( isset( $o['tabs'] ) &&
208
+ is_array( $o['tabs'] ) ) {
209
+ foreach( $o['tabs'] as $key => $oo ) {
210
+ if ( isset( $oo['sections'] ) &&
211
+ is_array( $oo['sections'] ) ) {
212
+ $this->loop_and_init_options( $oo['sections'] );
213
+ }
214
+ }
215
+ }
216
+ else if ( isset( $o['sections'] ) &&
217
+ is_array( $o['sections'] ) ) {
218
+ $this->loop_and_init_options( $o['sections'] );
219
+ }
220
+ }
221
+ }
222
+ }
223
 
224
  public function loop_and_init_options( $sections ) {
225
  foreach( $sections as $o ) {
300
  if ( isset( $oo['group'] ) && is_array( $oo['group'] ) ) {
301
  foreach ( $oo['group'] as $key => $ooo ) {
302
  if ( isset( $ooo['option_name'] ) ) {
303
+ if ( isset( $ooo['hide'] ) && $ooo['hide'] )
304
+ continue;
305
+
306
  $ooo['option_name'] = $this->plugin_prefix . $ooo['option_name'];
307
  $oo['group'][ $key ]['option_name'] = $ooo['option_name'];
308
 
321
  }
322
  else {
323
  if ( isset( $oo['option_name'] ) ) {
324
+ if ( isset( $oo['hide'] ) && $oo['hide'] )
325
+ continue;
326
+
327
  $oo['option_name'] = $this->plugin_prefix . $oo['option_name'];
328
 
329
  $callback = $this->get_callback( $oo );
readme.txt CHANGED
@@ -62,6 +62,10 @@ For more tutorials on our gallery plugin, go to our knowledge base.
62
 
63
  == Changelog ==
64
 
 
 
 
 
65
  = Version 1.52 =
66
 
67
  * updated owl carousel 2.1.4
62
 
63
  == Changelog ==
64
 
65
+ = Version 1.53 =
66
+
67
+ * updated wpc settings framework to version 1.0.2
68
+
69
  = Version 1.52 =
70
 
71
  * updated owl carousel 2.1.4
wc-gallery.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://wordpresscanvas.com/features/gallery/
5
  Description: Extend WordPress galleries to display masonry gallery, carousel gallery, and slider gallery
6
  Author: Chris Baldelomar
7
  Author URI: http://webplantmedia.com/
8
- Version: 1.52
9
  License: GPLv2 or later
10
  */
11
 
@@ -13,7 +13,7 @@ function wc_gallery_using_woocommerce() {
13
  return in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) );
14
  }
15
 
16
- define( 'WC_GALLERY_VERSION', '1.52' );
17
  define( 'WC_GALLERY_PREFIX', 'wc_gallery_' );
18
  define( '_WC_GALLERY_PREFIX', '_wc_gallery_' );
19
  define( 'WC_GALLERY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
@@ -25,6 +25,7 @@ global $wc_gallery_options;
25
  global $wc_gallery_theme_support;
26
 
27
  $wc_gallery_theme_support = array(
 
28
  'icon' => array(
29
  'size_w' => '48',
30
  'size_h' => '48',
5
  Description: Extend WordPress galleries to display masonry gallery, carousel gallery, and slider gallery
6
  Author: Chris Baldelomar
7
  Author URI: http://webplantmedia.com/
8
+ Version: 1.53
9
  License: GPLv2 or later
10
  */
11
 
13
  return in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) );
14
  }
15
 
16
+ define( 'WC_GALLERY_VERSION', '1.53' );
17
  define( 'WC_GALLERY_PREFIX', 'wc_gallery_' );
18
  define( '_WC_GALLERY_PREFIX', '_wc_gallery_' );
19
  define( 'WC_GALLERY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
25
  global $wc_gallery_theme_support;
26
 
27
  $wc_gallery_theme_support = array(
28
+ 'theme_reset' => true,
29
  'icon' => array(
30
  'size_w' => '48',
31
  'size_h' => '48',