Gutenberg Blocks – ACF Blocks Suite - Version 2.2.0

Version Description

  • Added Acf Meta Display Block (Free)
  • Bug Fixes
Download this release

Release Info

Developer munirkamal
Plugin Icon 128x128 Gutenberg Blocks – ACF Blocks Suite
Version 2.2.0
Comparing to
See all releases

Code changes from version 2.1.0 to 2.2.0

acf-blocks.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
 
3
  /**
4
- * Plugin Name: ACF Blocks
5
  * Plugin URI: https://acfblocks.com/
6
  * Description: Supercharge your Gutenberg editor with high quality beautiful WordPress blocks. Ready-to-use ACF Blocks!
7
- * Version: 2.1.0
8
  * Author: munirkamal
9
  * Author URI: https://munirkamal.wordpress.com
10
  * License: GPL2
@@ -680,7 +680,26 @@ if ( function_exists( 'acfb_fs' ) ) {
680
  'font_letter_spacing'
681
  ) );
682
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
683
 
 
 
 
 
 
684
  }
685
 
686
  // freemius end
1
  <?php
2
 
3
  /**
4
+ * Plugin Name: ACF Blocks Suite
5
  * Plugin URI: https://acfblocks.com/
6
  * Description: Supercharge your Gutenberg editor with high quality beautiful WordPress blocks. Ready-to-use ACF Blocks!
7
+ * Version: 2.2.0
8
  * Author: munirkamal
9
  * Author URI: https://munirkamal.wordpress.com
10
  * License: GPL2
680
  'font_letter_spacing'
681
  ) );
682
  }
683
+
684
+ // Acf meta Field Default Value
685
+ function acfb_meta_select_field( $field )
686
+ {
687
+ $value = get_field( 'acfb_meta_select_field' );
688
+ $key = $field['key'];
689
+ ?>
690
+ <script>
691
+ window.<?php
692
+ echo $key ;
693
+ ?> = `<?php
694
+ echo $value ;
695
+ ?>`;
696
+ </script>
697
 
698
+ <?php
699
+ }
700
+
701
+ // Apply to all fields.
702
+ add_action( 'acf/render_field/name=acfb_meta_select_field', 'acfb_meta_select_field' );
703
  }
704
 
705
  // freemius end
acf-json/group_5f198b1f97faf.json ADDED
@@ -0,0 +1,866 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "key": "group_5f198b1f97faf",
3
+ "title": "Acf Meta Field",
4
+ "fields": [
5
+ {
6
+ "key": "field_5f2171e90fecc",
7
+ "label": "Content",
8
+ "name": "",
9
+ "type": "tab",
10
+ "instructions": "",
11
+ "required": 0,
12
+ "conditional_logic": 0,
13
+ "wrapper": {
14
+ "width": "",
15
+ "class": "",
16
+ "id": ""
17
+ },
18
+ "placement": "top",
19
+ "endpoint": 0
20
+ },
21
+ {
22
+ "key": "field_5f2e83dc77721",
23
+ "label": "Before Text",
24
+ "name": "acfb_meta_field_before_text",
25
+ "type": "text",
26
+ "instructions": "",
27
+ "required": 0,
28
+ "conditional_logic": 0,
29
+ "wrapper": {
30
+ "width": "",
31
+ "class": "",
32
+ "id": ""
33
+ },
34
+ "default_value": "",
35
+ "placeholder": "Before Text",
36
+ "prepend": "",
37
+ "append": "",
38
+ "maxlength": ""
39
+ },
40
+ {
41
+ "key": "field_5f198d0f4c53e",
42
+ "label": "Select Field",
43
+ "name": "acfb_meta_select_field",
44
+ "type": "select",
45
+ "instructions": "",
46
+ "required": 0,
47
+ "conditional_logic": 0,
48
+ "wrapper": {
49
+ "width": "",
50
+ "class": "",
51
+ "id": ""
52
+ },
53
+ "choices": [],
54
+ "default_value": false,
55
+ "allow_null": 0,
56
+ "multiple": 0,
57
+ "ui": 0,
58
+ "return_format": "value",
59
+ "ajax": 0,
60
+ "placeholder": ""
61
+ },
62
+ {
63
+ "key": "field_5f215761af022",
64
+ "label": "Select Field Type",
65
+ "name": "acfb_meta_select_field_type",
66
+ "type": "select",
67
+ "instructions": "",
68
+ "required": 0,
69
+ "conditional_logic": 0,
70
+ "wrapper": {
71
+ "width": "",
72
+ "class": "",
73
+ "id": ""
74
+ },
75
+ "choices": {
76
+ "selecttype": "Select Field Type",
77
+ "text": "Text",
78
+ "visual": "Visual Editor",
79
+ "textarea": "Textarea",
80
+ "date": "Date",
81
+ "number": "Number",
82
+ "url": "Url",
83
+ "select": "Select",
84
+ "radio": "Radio",
85
+ "image": "Image",
86
+ "oembed": "Oembed",
87
+ "gallery": "Gallery"
88
+ },
89
+ "default_value": "select",
90
+ "allow_null": 0,
91
+ "multiple": 0,
92
+ "ui": 0,
93
+ "return_format": "value",
94
+ "ajax": 0,
95
+ "placeholder": ""
96
+ },
97
+ {
98
+ "key": "field_5f2e840177722",
99
+ "label": "After Text",
100
+ "name": "acfb_meta_field_after_text",
101
+ "type": "text",
102
+ "instructions": "",
103
+ "required": 0,
104
+ "conditional_logic": 0,
105
+ "wrapper": {
106
+ "width": "",
107
+ "class": "",
108
+ "id": ""
109
+ },
110
+ "default_value": "",
111
+ "placeholder": "After Text",
112
+ "prepend": "",
113
+ "append": "",
114
+ "maxlength": ""
115
+ },
116
+ {
117
+ "key": "field_5f24019116155",
118
+ "label": "Url to Button",
119
+ "name": "acfb_url_field_type_to_button",
120
+ "type": "true_false",
121
+ "instructions": "",
122
+ "required": 0,
123
+ "conditional_logic": [
124
+ [
125
+ {
126
+ "field": "field_5f215761af022",
127
+ "operator": "==",
128
+ "value": "url"
129
+ }
130
+ ]
131
+ ],
132
+ "wrapper": {
133
+ "width": "",
134
+ "class": "",
135
+ "id": ""
136
+ },
137
+ "message": "",
138
+ "default_value": 0,
139
+ "ui": 1,
140
+ "ui_on_text": "",
141
+ "ui_off_text": ""
142
+ },
143
+ {
144
+ "key": "field_5f2401de16156",
145
+ "label": "Button Text",
146
+ "name": "acfb_url_field_type_to_button_text",
147
+ "type": "text",
148
+ "instructions": "",
149
+ "required": 0,
150
+ "conditional_logic": [
151
+ [
152
+ {
153
+ "field": "field_5f24019116155",
154
+ "operator": "==",
155
+ "value": "1"
156
+ }
157
+ ]
158
+ ],
159
+ "wrapper": {
160
+ "width": "",
161
+ "class": "",
162
+ "id": ""
163
+ },
164
+ "default_value": "Button Text",
165
+ "placeholder": "Button Text",
166
+ "prepend": "",
167
+ "append": "",
168
+ "maxlength": ""
169
+ },
170
+ {
171
+ "key": "field_5f2d447ac6aa0",
172
+ "label": "Image Alt",
173
+ "name": "acfb_image_field_alt_text",
174
+ "type": "text",
175
+ "instructions": "",
176
+ "required": 0,
177
+ "conditional_logic": [
178
+ [
179
+ {
180
+ "field": "field_5f215761af022",
181
+ "operator": "==",
182
+ "value": "image"
183
+ }
184
+ ]
185
+ ],
186
+ "wrapper": {
187
+ "width": "",
188
+ "class": "",
189
+ "id": ""
190
+ },
191
+ "default_value": "alt text",
192
+ "placeholder": "alt text",
193
+ "prepend": "",
194
+ "append": "",
195
+ "maxlength": ""
196
+ },
197
+ {
198
+ "key": "field_5f2ac076ac1ba",
199
+ "label": "Columns",
200
+ "name": "acfb_url_field_type_gallery_columns",
201
+ "type": "range",
202
+ "instructions": "",
203
+ "required": 0,
204
+ "conditional_logic": [
205
+ [
206
+ {
207
+ "field": "field_5f215761af022",
208
+ "operator": "==",
209
+ "value": "gallery"
210
+ }
211
+ ]
212
+ ],
213
+ "wrapper": {
214
+ "width": "",
215
+ "class": "",
216
+ "id": ""
217
+ },
218
+ "default_value": 2,
219
+ "min": 1,
220
+ "max": 5,
221
+ "step": "",
222
+ "prepend": "",
223
+ "append": ""
224
+ },
225
+ {
226
+ "key": "field_5f2be88a3c81f",
227
+ "label": "Image Sizes",
228
+ "name": "acfb_url_field_type_gallery_img_size",
229
+ "type": "select",
230
+ "instructions": "",
231
+ "required": 0,
232
+ "conditional_logic": [
233
+ [
234
+ {
235
+ "field": "field_5f215761af022",
236
+ "operator": "==",
237
+ "value": "gallery"
238
+ }
239
+ ],
240
+ [
241
+ {
242
+ "field": "field_5f215761af022",
243
+ "operator": "==",
244
+ "value": "image"
245
+ }
246
+ ]
247
+ ],
248
+ "wrapper": {
249
+ "width": "",
250
+ "class": "",
251
+ "id": ""
252
+ },
253
+ "choices": {
254
+ "thumbnail": "Thumbnail",
255
+ "medium": "Medium",
256
+ "large": "Large",
257
+ "full": "Full Size"
258
+ },
259
+ "default_value": "full",
260
+ "allow_null": 0,
261
+ "multiple": 0,
262
+ "ui": 0,
263
+ "return_format": "value",
264
+ "ajax": 0,
265
+ "placeholder": ""
266
+ },
267
+ {
268
+ "key": "field_5f2e90fdc29ed",
269
+ "label": "Content Alignment",
270
+ "name": "acfb_meta_field_content_align",
271
+ "type": "button_group",
272
+ "instructions": "",
273
+ "required": 0,
274
+ "conditional_logic": 0,
275
+ "wrapper": {
276
+ "width": "",
277
+ "class": "",
278
+ "id": ""
279
+ },
280
+ "choices": {
281
+ "vertical": "Vertical",
282
+ "horizontal": "Horizontal"
283
+ },
284
+ "allow_null": 0,
285
+ "default_value": "horizontal",
286
+ "layout": "horizontal",
287
+ "return_format": "value"
288
+ },
289
+ {
290
+ "key": "field_5f23fcecfc39c",
291
+ "label": "Vertical Alignment",
292
+ "name": "acfb_select_field_type_vertical_alignment",
293
+ "type": "select",
294
+ "instructions": "",
295
+ "required": 0,
296
+ "conditional_logic": [
297
+ [
298
+ {
299
+ "field": "field_5f2e90fdc29ed",
300
+ "operator": "==",
301
+ "value": "vertical"
302
+ }
303
+ ]
304
+ ],
305
+ "wrapper": {
306
+ "width": "",
307
+ "class": "",
308
+ "id": ""
309
+ },
310
+ "choices": {
311
+ "flex-start": "Left",
312
+ "center": "Center",
313
+ "flex-end": "Right"
314
+ },
315
+ "default_value": "flex-start",
316
+ "allow_null": 0,
317
+ "multiple": 0,
318
+ "ui": 0,
319
+ "return_format": "value",
320
+ "ajax": 0,
321
+ "placeholder": ""
322
+ },
323
+ {
324
+ "key": "field_5f2e9303efdd9",
325
+ "label": "Horizontal Alignment",
326
+ "name": "acfb_select_field_type_horizontal_alignment",
327
+ "type": "select",
328
+ "instructions": "",
329
+ "required": 0,
330
+ "conditional_logic": [
331
+ [
332
+ {
333
+ "field": "field_5f2e90fdc29ed",
334
+ "operator": "==",
335
+ "value": "horizontal"
336
+ }
337
+ ]
338
+ ],
339
+ "wrapper": {
340
+ "width": "",
341
+ "class": "",
342
+ "id": ""
343
+ },
344
+ "choices": {
345
+ "flex-start": "Left",
346
+ "center": "Center",
347
+ "flex-end": "Right"
348
+ },
349
+ "default_value": "flex-start",
350
+ "allow_null": 0,
351
+ "multiple": 0,
352
+ "ui": 0,
353
+ "return_format": "value",
354
+ "ajax": 0,
355
+ "placeholder": ""
356
+ },
357
+ {
358
+ "key": "field_5f1c42d6206b7",
359
+ "label": "Post ID",
360
+ "name": "post_id",
361
+ "type": "text",
362
+ "instructions": "",
363
+ "required": 0,
364
+ "conditional_logic": 0,
365
+ "wrapper": {
366
+ "width": "",
367
+ "class": "",
368
+ "id": ""
369
+ },
370
+ "default_value": "",
371
+ "placeholder": "",
372
+ "prepend": "",
373
+ "append": "",
374
+ "maxlength": ""
375
+ },
376
+ {
377
+ "key": "field_5f2171f70fecd",
378
+ "label": "Design",
379
+ "name": "",
380
+ "type": "tab",
381
+ "instructions": "",
382
+ "required": 0,
383
+ "conditional_logic": 0,
384
+ "wrapper": {
385
+ "width": "",
386
+ "class": "",
387
+ "id": ""
388
+ },
389
+ "placement": "top",
390
+ "endpoint": 0
391
+ },
392
+ {
393
+ "key": "field_5f21738411189",
394
+ "label": "Typography",
395
+ "name": "",
396
+ "type": "accordion",
397
+ "instructions": "",
398
+ "required": 0,
399
+ "conditional_logic": 0,
400
+ "wrapper": {
401
+ "width": "",
402
+ "class": "",
403
+ "id": ""
404
+ },
405
+ "open": 0,
406
+ "multi_expand": 0,
407
+ "endpoint": 0
408
+ },
409
+ {
410
+ "key": "field_5f31072e91356",
411
+ "label": "Before Text Typography",
412
+ "name": "acfb_field_before_text_typography",
413
+ "type": "typography",
414
+ "instructions": "",
415
+ "required": 0,
416
+ "conditional_logic": 0,
417
+ "wrapper": {
418
+ "width": "",
419
+ "class": "",
420
+ "id": ""
421
+ },
422
+ "font_family_enable": 0,
423
+ "font_family": "default",
424
+ "font_size": 18,
425
+ "font_weight": "default",
426
+ "font_transform": "default",
427
+ "font_style": "default",
428
+ "font_decoration": "default",
429
+ "font_line_height": "0.1",
430
+ "font_letter_spacing": 0
431
+ },
432
+ {
433
+ "key": "field_5f2175bf1118e",
434
+ "label": "Content Typography",
435
+ "name": "acfb_field_content_typography",
436
+ "type": "typography",
437
+ "instructions": "",
438
+ "required": 0,
439
+ "conditional_logic": 0,
440
+ "wrapper": {
441
+ "width": "",
442
+ "class": "",
443
+ "id": ""
444
+ },
445
+ "font_family_enable": 0,
446
+ "font_family": "default",
447
+ "font_size": 18,
448
+ "font_weight": "default",
449
+ "font_transform": "default",
450
+ "font_style": "default",
451
+ "font_decoration": "default",
452
+ "font_line_height": "0.1",
453
+ "font_letter_spacing": 0
454
+ },
455
+ {
456
+ "key": "field_5f31074591357",
457
+ "label": "After Text Typography",
458
+ "name": "acfb_field_after_text_typography",
459
+ "type": "typography",
460
+ "instructions": "",
461
+ "required": 0,
462
+ "conditional_logic": 0,
463
+ "wrapper": {
464
+ "width": "",
465
+ "class": "",
466
+ "id": ""
467
+ },
468
+ "font_family_enable": 0,
469
+ "font_family": "default",
470
+ "font_size": 18,
471
+ "font_weight": "default",
472
+ "font_transform": "default",
473
+ "font_style": "default",
474
+ "font_decoration": "default",
475
+ "font_line_height": "0.1",
476
+ "font_letter_spacing": 0
477
+ },
478
+ {
479
+ "key": "field_5f217b473ade1",
480
+ "label": "Html Tag",
481
+ "name": "acfb_field_content_html_tag",
482
+ "type": "button_group",
483
+ "instructions": "",
484
+ "required": 0,
485
+ "conditional_logic": [
486
+ [
487
+ {
488
+ "field": "field_5f215761af022",
489
+ "operator": "!=",
490
+ "value": "image"
491
+ },
492
+ {
493
+ "field": "field_5f215761af022",
494
+ "operator": "!=",
495
+ "value": "oembed"
496
+ },
497
+ {
498
+ "field": "field_5f215761af022",
499
+ "operator": "!=",
500
+ "value": "url"
501
+ }
502
+ ]
503
+ ],
504
+ "wrapper": {
505
+ "width": "",
506
+ "class": "",
507
+ "id": ""
508
+ },
509
+ "choices": {
510
+ "h1": "H1",
511
+ "h2": "H2",
512
+ "h3": "H3",
513
+ "h4": "H4",
514
+ "h5": "H5",
515
+ "h6": "H6",
516
+ "p": "P",
517
+ "span": "Span",
518
+ "div": "div"
519
+ },
520
+ "allow_null": 0,
521
+ "default_value": "p",
522
+ "layout": "horizontal",
523
+ "return_format": "value"
524
+ },
525
+ {
526
+ "key": "field_5f2173a21118a",
527
+ "label": "Colors",
528
+ "name": "",
529
+ "type": "accordion",
530
+ "instructions": "",
531
+ "required": 0,
532
+ "conditional_logic": 0,
533
+ "wrapper": {
534
+ "width": "",
535
+ "class": "",
536
+ "id": ""
537
+ },
538
+ "open": 0,
539
+ "multi_expand": 0,
540
+ "endpoint": 0
541
+ },
542
+ {
543
+ "key": "field_5f217acc75380",
544
+ "label": "Background Color",
545
+ "name": "acfb_field_bg_color",
546
+ "type": "color_picker",
547
+ "instructions": "",
548
+ "required": 0,
549
+ "conditional_logic": 0,
550
+ "wrapper": {
551
+ "width": "",
552
+ "class": "",
553
+ "id": ""
554
+ },
555
+ "default_value": ""
556
+ },
557
+ {
558
+ "key": "field_5f31075a91358",
559
+ "label": "Before Text Color",
560
+ "name": "acfb_field_before_text_color",
561
+ "type": "color_picker",
562
+ "instructions": "",
563
+ "required": 0,
564
+ "conditional_logic": 0,
565
+ "wrapper": {
566
+ "width": "",
567
+ "class": "",
568
+ "id": ""
569
+ },
570
+ "default_value": "#000000"
571
+ },
572
+ {
573
+ "key": "field_5f2175f81118f",
574
+ "label": "Content Color",
575
+ "name": "acfb_field_content_color",
576
+ "type": "color_picker",
577
+ "instructions": "",
578
+ "required": 0,
579
+ "conditional_logic": 0,
580
+ "wrapper": {
581
+ "width": "",
582
+ "class": "",
583
+ "id": ""
584
+ },
585
+ "default_value": "#000000"
586
+ },
587
+ {
588
+ "key": "field_5f31076391359",
589
+ "label": "After Text Color",
590
+ "name": "acfb_field_after_text_color",
591
+ "type": "color_picker",
592
+ "instructions": "",
593
+ "required": 0,
594
+ "conditional_logic": 0,
595
+ "wrapper": {
596
+ "width": "",
597
+ "class": "",
598
+ "id": ""
599
+ },
600
+ "default_value": "#000000"
601
+ },
602
+ {
603
+ "key": "field_5f240308e1059",
604
+ "label": "Button Background Color",
605
+ "name": "acfb_field_url_button_bg_color",
606
+ "type": "color_picker",
607
+ "instructions": "",
608
+ "required": 0,
609
+ "conditional_logic": [
610
+ [
611
+ {
612
+ "field": "field_5f24019116155",
613
+ "operator": "==",
614
+ "value": "1"
615
+ }
616
+ ]
617
+ ],
618
+ "wrapper": {
619
+ "width": "",
620
+ "class": "",
621
+ "id": ""
622
+ },
623
+ "default_value": "#e0e0e0"
624
+ },
625
+ {
626
+ "key": "field_5f240346e105a",
627
+ "label": "Button Color",
628
+ "name": "acfb_field_url_button_color",
629
+ "type": "color_picker",
630
+ "instructions": "",
631
+ "required": 0,
632
+ "conditional_logic": [
633
+ [
634
+ {
635
+ "field": "field_5f24019116155",
636
+ "operator": "==",
637
+ "value": "1"
638
+ }
639
+ ]
640
+ ],
641
+ "wrapper": {
642
+ "width": "",
643
+ "class": "",
644
+ "id": ""
645
+ },
646
+ "default_value": "#191e23"
647
+ },
648
+ {
649
+ "key": "field_5f240384e105b",
650
+ "label": "Button Background Hover Color",
651
+ "name": "acfb_field_url_button_bg_hover_color",
652
+ "type": "color_picker",
653
+ "instructions": "",
654
+ "required": 0,
655
+ "conditional_logic": [
656
+ [
657
+ {
658
+ "field": "field_5f24019116155",
659
+ "operator": "==",
660
+ "value": "1"
661
+ }
662
+ ]
663
+ ],
664
+ "wrapper": {
665
+ "width": "",
666
+ "class": "",
667
+ "id": ""
668
+ },
669
+ "default_value": "#e0e0e0"
670
+ },
671
+ {
672
+ "key": "field_5f240399e105c",
673
+ "label": "Button Hover Color",
674
+ "name": "acfb_field_url_button_hover_color",
675
+ "type": "color_picker",
676
+ "instructions": "",
677
+ "required": 0,
678
+ "conditional_logic": [
679
+ [
680
+ {
681
+ "field": "field_5f24019116155",
682
+ "operator": "==",
683
+ "value": "1"
684
+ }
685
+ ]
686
+ ],
687
+ "wrapper": {
688
+ "width": "",
689
+ "class": "",
690
+ "id": ""
691
+ },
692
+ "default_value": "#191e23"
693
+ },
694
+ {
695
+ "key": "field_5f24085c2d24f",
696
+ "label": "Sizing",
697
+ "name": "",
698
+ "type": "accordion",
699
+ "instructions": "",
700
+ "required": 0,
701
+ "conditional_logic": [
702
+ [
703
+ {
704
+ "field": "field_5f215761af022",
705
+ "operator": "==",
706
+ "value": "image"
707
+ }
708
+ ],
709
+ [
710
+ {
711
+ "field": "field_5f215761af022",
712
+ "operator": "==",
713
+ "value": "oembed"
714
+ }
715
+ ]
716
+ ],
717
+ "wrapper": {
718
+ "width": "",
719
+ "class": "",
720
+ "id": ""
721
+ },
722
+ "open": 0,
723
+ "multi_expand": 0,
724
+ "endpoint": 0
725
+ },
726
+ {
727
+ "key": "field_5f2408672d250",
728
+ "label": "Width",
729
+ "name": "acfb_field_image_width",
730
+ "type": "range",
731
+ "instructions": "",
732
+ "required": 0,
733
+ "conditional_logic": 0,
734
+ "wrapper": {
735
+ "width": "",
736
+ "class": "",
737
+ "id": ""
738
+ },
739
+ "default_value": 100,
740
+ "min": "",
741
+ "max": "",
742
+ "step": "",
743
+ "prepend": "",
744
+ "append": "%"
745
+ },
746
+ {
747
+ "key": "field_5f2173aa1118b",
748
+ "label": "Spacing",
749
+ "name": "",
750
+ "type": "accordion",
751
+ "instructions": "",
752
+ "required": 0,
753
+ "conditional_logic": 0,
754
+ "wrapper": {
755
+ "width": "",
756
+ "class": "",
757
+ "id": ""
758
+ },
759
+ "open": 0,
760
+ "multi_expand": 0,
761
+ "endpoint": 0
762
+ },
763
+ {
764
+ "key": "field_5f21762911190",
765
+ "label": "Margin",
766
+ "name": "acfb_data_field_margin",
767
+ "type": "margin",
768
+ "instructions": "",
769
+ "required": 0,
770
+ "conditional_logic": 0,
771
+ "wrapper": {
772
+ "width": "",
773
+ "class": "",
774
+ "id": ""
775
+ },
776
+ "margin_enable": 0,
777
+ "margin_top": "",
778
+ "margin_right": "",
779
+ "margin_bottom": "",
780
+ "margin_left": ""
781
+ },
782
+ {
783
+ "key": "field_5f21764611191",
784
+ "label": "Padding",
785
+ "name": "acfb_data_field_padding",
786
+ "type": "padding",
787
+ "instructions": "",
788
+ "required": 0,
789
+ "conditional_logic": 0,
790
+ "wrapper": {
791
+ "width": "",
792
+ "class": "",
793
+ "id": ""
794
+ },
795
+ "padding_enable": 0,
796
+ "padding_top": "",
797
+ "padding_right": "",
798
+ "padding_bottom": "",
799
+ "padding_left": ""
800
+ },
801
+ {
802
+ "key": "field_5f23fbc2bff72",
803
+ "label": "Inner Padding",
804
+ "name": "acfb_data_field_inner_padding",
805
+ "type": "padding",
806
+ "instructions": "",
807
+ "required": 0,
808
+ "conditional_logic": 0,
809
+ "wrapper": {
810
+ "width": "",
811
+ "class": "",
812
+ "id": ""
813
+ },
814
+ "padding_enable": 0,
815
+ "padding_top": "",
816
+ "padding_right": "",
817
+ "padding_bottom": "",
818
+ "padding_left": ""
819
+ },
820
+ {
821
+ "key": "field_5f2404d0207d7",
822
+ "label": "Button Padding",
823
+ "name": "acfb_data_field_button_padding",
824
+ "type": "padding",
825
+ "instructions": "",
826
+ "required": 0,
827
+ "conditional_logic": [
828
+ [
829
+ {
830
+ "field": "field_5f24019116155",
831
+ "operator": "==",
832
+ "value": "1"
833
+ }
834
+ ]
835
+ ],
836
+ "wrapper": {
837
+ "width": "",
838
+ "class": "",
839
+ "id": ""
840
+ },
841
+ "padding_enable": 0,
842
+ "padding_top": 10,
843
+ "padding_right": 20,
844
+ "padding_bottom": 10,
845
+ "padding_left": 20
846
+ }
847
+ ],
848
+ "location": [
849
+ [
850
+ {
851
+ "param": "block",
852
+ "operator": "==",
853
+ "value": "acf\/acfb-meta-display"
854
+ }
855
+ ]
856
+ ],
857
+ "menu_order": 0,
858
+ "position": "normal",
859
+ "style": "default",
860
+ "label_placement": "left",
861
+ "instruction_placement": "label",
862
+ "hide_on_screen": "",
863
+ "active": true,
864
+ "description": "",
865
+ "modified": 1597060638
866
+ }
block-templates/free/acfb-meta-display.php ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once plugin_dir_path( __DIR__ ) . 'functions/function.php';
3
+
4
+ $acfb_meta_display_post_id = (int)get_field('post_id'); # hidden field in order to obtain post id
5
+ $acfb_meta_field = getCustomField('acfb_meta_select_field', $acfb_meta_display_post_id);
6
+
7
+ echo parse_link(
8
+ array(
9
+ get_field('acfb_field_content_typography')
10
+ )
11
+ );
12
+
13
+ $acfb_data_field_inner_padding = acfb_padding_name('acfb_data_field_inner_padding');
14
+ $acfb_data_field_button_padding = acfb_padding_name('acfb_data_field_button_padding');
15
+ $acfb_data_field_padding = acfb_padding_name('acfb_data_field_padding');
16
+ $acfb_data_field_margin = acfb_margin_name('acfb_data_field_margin');
17
+ $acfb_field_content_typography = acfb_ffaimly_name('acfb_field_content_typography');
18
+ $acfb_field_before_text_typography = acfb_ffaimly_name('acfb_field_before_text_typography');
19
+ $acfb_field_after_text_typography = acfb_ffaimly_name('acfb_field_after_text_typography');
20
+
21
+
22
+ $acfb_meta_tag = get_field('acfb_field_content_html_tag');
23
+ $acfb_meta_value = $acfb_meta_field['value'];
24
+ $acfb_meta_type = get_field('acfb_meta_select_field_type');
25
+
26
+
27
+ $uid = $block['id'];
28
+
29
+ $className = 'acfb_meta_display_block';
30
+ if( !empty($block['className']) ) {
31
+ $className .= ' ' . $block['className'];
32
+ }
33
+ if( !empty($block['align']) ) {
34
+ $className .= ' align' . $block['align'];
35
+ }
36
+ ?>
37
+ <div class="<?php echo $uid; ?> <?php echo esc_attr($className); ?>">
38
+ <style type="text/css">
39
+ .<?php echo $uid; ?>{
40
+ <?php echo get_padding_field($acfb_data_field_padding); ?>
41
+ <?php echo get_margin_field($acfb_data_field_margin); ?>
42
+ }
43
+
44
+ .<?php echo $uid; ?> .acfb_meta_display{
45
+ <?php if($acfb_meta_type !== 'image' || $acfb_meta_type !== 'oembed'): ?>
46
+ background: <?php the_field('acfb_field_bg_color'); ?>;
47
+ color: <?php the_field('acfb_field_content_color'); ?>;
48
+ <?php endif; ?>
49
+ <?php echo get_padding_field($acfb_data_field_inner_padding); ?>
50
+ <?php if(get_field('acfb_meta_field_content_align') === 'horizontal'): ?>
51
+ display: flex;
52
+ gap: 10px;
53
+ justify-content: <?php the_field('acfb_select_field_type_horizontal_alignment') ?>;
54
+ <?php elseif(get_field('acfb_meta_field_content_align') === 'vertical'): ?>
55
+ display: flex;
56
+ flex-direction: column;
57
+ gap: 10px;
58
+ align-items: <?php the_field('acfb_select_field_type_vertical_alignment') ?>;
59
+ <?php endif; ?>
60
+
61
+ }
62
+
63
+ <?php if($acfb_meta_type !== 'image' or $acfb_meta_type !== 'oembed' or $acfb_meta_type !== 'gallery'): ?>
64
+ .<?php echo $uid; ?> .acfb_meta_display <?php the_field('acfb_field_content_html_tag'); ?>{
65
+ <?php echo get_typo_field($acfb_field_content_typography); ?>
66
+ margin: 0;
67
+ }
68
+ <?php endif; ?>
69
+
70
+
71
+ .<?php echo $uid; ?> .acfb_meta_display .acfb_meta_display_before_text{
72
+ color: <?php the_field('acfb_field_before_text_color'); ?>;
73
+ <?php echo get_typo_field($acfb_field_before_text_typography); ?>
74
+ }
75
+
76
+
77
+ .<?php echo $uid; ?> .acfb_meta_display .acfb_meta_display_after_text{
78
+ color: <?php the_field('acfb_field_after_text_color'); ?>;
79
+ <?php echo get_typo_field($acfb_field_after_text_typography); ?>
80
+ }
81
+
82
+ .<?php echo $uid; ?> .acfb_meta_display .acfb_url_to_button{
83
+ background: <?php the_field('acfb_field_url_button_bg_color'); ?>;
84
+ color: <?php the_field('acfb_field_url_button_color'); ?>;
85
+ <?php echo get_padding_field($acfb_data_field_button_padding); ?>
86
+ }
87
+
88
+ .<?php echo $uid; ?> .acfb_meta_display .acfb_url_to_button:hover{
89
+ background: <?php the_field('acfb_field_url_button_bg_hover_color'); ?>;
90
+ color: <?php the_field('acfb_field_url_button_hover_color'); ?>;
91
+ }
92
+
93
+ .<?php echo $uid; ?> .acfb_field_type_img{
94
+ width: <?php the_field('acfb_field_image_width'); ?>%;
95
+ }
96
+ </style>
97
+
98
+
99
+ <div class="acfb_meta_display">
100
+
101
+ <?php
102
+ if(get_field('acfb_meta_field_before_text')){ ?>
103
+ <div class="acfb_meta_display_before_text">
104
+ <?php the_field('acfb_meta_field_before_text'); ?>
105
+ </div>
106
+ <?php } ?>
107
+
108
+
109
+ <?php if(
110
+ $acfb_meta_type === 'text' or
111
+ $acfb_meta_type === 'visual' or
112
+ $acfb_meta_type === 'textarea' or
113
+ $acfb_meta_type === 'date' or
114
+ $acfb_meta_type === 'number' or
115
+ $acfb_meta_type === 'url' or
116
+ $acfb_meta_type === 'select' or
117
+ $acfb_meta_type === 'radio' or
118
+ $acfb_meta_type === 'image' or
119
+ $acfb_meta_type === 'oembed' or
120
+ $acfb_meta_type === 'gallery'
121
+ ):
122
+
123
+
124
+ if($acfb_meta_type === 'url'){
125
+
126
+ if(get_field('acfb_url_field_type_to_button') === true){
127
+ echo "<a href='". $acfb_meta_value ."' class='acfb_url_to_button'>". get_field('acfb_url_field_type_to_button_text') ."</a>";
128
+ } else{
129
+ echo $acfb_meta_value;
130
+ }
131
+
132
+ } elseif($acfb_meta_type === 'image'){
133
+
134
+ $acfb_meta_image = $acfb_meta_value;
135
+ $acfb_meta_image_size = get_field('acfb_url_field_type_gallery_img_size');
136
+ $acfb_meta_image_id = acfb_meta_gallery_get_image_id($acfb_meta_image);
137
+ // retrieve the thumbnail size of our image
138
+ $acfb_meta_image_thumb = wp_get_attachment_image_src($acfb_meta_image_id, $acfb_meta_image_size);
139
+
140
+
141
+ echo "<img src=". $acfb_meta_image_thumb['0'] ." alt='". get_field('acfb_image_field_alt_text') ."' class='acfb_field_type_img'>";
142
+
143
+ } elseif($acfb_meta_type === 'oembed'){
144
+
145
+ echo $acfb_meta_value;
146
+
147
+ } elseif($acfb_meta_type === 'gallery'){
148
+
149
+ $acfb_meta_gallery_images = $acfb_meta_value;
150
+ $acfb_meta_gallery_images_size = get_field('acfb_url_field_type_gallery_img_size'); // (thumbnail, medium, large, full or custom size)
151
+ if( $acfb_meta_gallery_images ): ?>
152
+ <div class="acfb_meta_display_gallery acfb_meta_display_gallery_<?php the_field('acfb_url_field_type_gallery_columns'); ?>">
153
+ <?php foreach( $acfb_meta_gallery_images as $acfb_meta_gallery_images ): ?>
154
+ <div class="gallery_item">
155
+ <?php
156
+ // store the image ID in a var
157
+ $acfb_meta_gallery_images_id = acfb_meta_gallery_get_image_id($acfb_meta_gallery_images);
158
+
159
+ // retrieve the thumbnail size of our image
160
+ $acfb_meta_gallery_image_thumb = wp_get_attachment_image_src($acfb_meta_gallery_images_id, $acfb_meta_gallery_images_size);
161
+ ?>
162
+
163
+ <img src="<?php echo $acfb_meta_gallery_image_thumb[0] ?>">
164
+ </div>
165
+ <?php endforeach; ?>
166
+ </div>
167
+ <?php endif;
168
+
169
+ } else{
170
+
171
+ echo "<" . $acfb_meta_tag . ">";
172
+ echo $acfb_meta_value;
173
+ echo "</" . $acfb_meta_tag . ">";
174
+
175
+ }
176
+
177
+ endif;
178
+ ?>
179
+
180
+
181
+ <?php
182
+ if(get_field('acfb_meta_field_after_text')){ ?>
183
+ <div class="acfb_meta_display_after_text">
184
+ <?php the_field('acfb_meta_field_after_text'); ?>
185
+ </div>
186
+ <?php } ?>
187
+
188
+
189
+ </div>
190
+ </div><!-- Uid -->
block-templates/functions/function.php CHANGED
@@ -1,35 +1,56 @@
1
- <?php
2
-
3
- function parse_link( $fields ) {
4
-
5
- $acfb_families = array();
6
-
7
-
8
- foreach ( $fields as $key => $field ) {
9
-
10
- if (is_array($field) and array_key_exists('font_family', $field) ) {
11
-
12
- $acfb_font_family = $field['font_family'];
13
-
14
- if ( $acfb_font_family !== "" and $acfb_font_family !== NULL and $acfb_font_family !== 'default' ) {
15
- $acfb_families[] = $acfb_font_family;
16
- }
17
-
18
- }
19
-
20
- }
21
-
22
- if (!empty($acfb_families)) {
23
- $family_merges = join('&family=', $acfb_families);
24
-
25
- return "<link href='https://fonts.googleapis.com/css2?family=$family_merges' rel='stylesheet'>";
26
-
27
- } else return "";
28
-
29
-
30
- }
31
-
32
-
33
- function get_family( $family ) {
34
- return str_replace('+', " ", $family);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  }
1
+ <?php
2
+ function parse_link( $fields ) {
3
+
4
+ $acfb_families = array();
5
+
6
+
7
+ foreach ( $fields as $key => $field ) {
8
+
9
+ if (is_array($field) and array_key_exists('font_family', $field) ) {
10
+
11
+ $acfb_font_family = $field['font_family'];
12
+
13
+ if ( $acfb_font_family !== "" and $acfb_font_family !== NULL and $acfb_font_family !== 'default' ) {
14
+ $acfb_families[] = $acfb_font_family;
15
+ }
16
+
17
+ }
18
+
19
+ }
20
+
21
+ if (!empty($acfb_families)) {
22
+ $family_merges = join('&family=', $acfb_families);
23
+
24
+ return "<link href='https://fonts.googleapis.com/css2?family=$family_merges' rel='stylesheet'>";
25
+
26
+ } else return "";
27
+
28
+
29
+ }
30
+
31
+
32
+ function get_family( $family ) {
33
+ return str_replace('+', " ", $family);
34
+ }
35
+
36
+
37
+
38
+
39
+ function getCustomField($field_name, $post_id){
40
+
41
+ $selected_field = get_field($field_name);
42
+ $selected_field_data = json_decode($selected_field, true);
43
+
44
+ return [
45
+ 'type' => $selected_field_data['type'],
46
+ 'value' => get_field($selected_field_data['name'], $post_id)
47
+ ];
48
+ }
49
+
50
+
51
+ // retrieves the attachment ID from the file URL for acf meta gallery
52
+ function acfb_meta_gallery_get_image_id($acfb_meta_gallery_image_url) {
53
+ global $wpdb;
54
+ $attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $acfb_meta_gallery_image_url ));
55
+ return $attachment[0];
56
  }
css/acfblocks.css CHANGED
@@ -3124,6 +3124,34 @@ transition: all .3s .3s;
3124
 
3125
 
3126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3127
 
3128
  /************ Content Toggle CSS ************/
3129
  /*.acfb_ct_btn_wrap{
3124
 
3125
 
3126
 
3127
+ /************ Acf Data Display CSS ************/
3128
+ .acfb_meta_display .acfb_meta_display_gallery{
3129
+ display: grid;
3130
+ grid-gap: 10px;
3131
+ align-items: center;
3132
+ justify-items: center;
3133
+ width: 100%;
3134
+ }
3135
+
3136
+ .acfb_meta_display .acfb_meta_display_gallery_2{
3137
+ grid-template-columns: repeat(2, calc(50% - 10px));
3138
+ }
3139
+
3140
+ .acfb_meta_display .acfb_meta_display_gallery_3{
3141
+ grid-template-columns: repeat(3, calc(33.33% - 10px));
3142
+ }
3143
+
3144
+ .acfb_meta_display .acfb_meta_display_gallery_4{
3145
+ grid-template-columns: repeat(4, calc(25% - 10px));
3146
+ }
3147
+
3148
+ .acfb_meta_display .acfb_meta_display_gallery_5{
3149
+ grid-template-columns: repeat(5, calc(20% - 10px));
3150
+ }
3151
+
3152
+
3153
+
3154
+
3155
 
3156
  /************ Content Toggle CSS ************/
3157
  /*.acfb_ct_btn_wrap{
free-acf-blocks.php CHANGED
@@ -360,6 +360,25 @@ function acfb_blocks_free() {
360
  },
361
  ));
362
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
363
 
364
 
365
  }
360
  },
361
  ));
362
 
363
+ // register a Acf Meta Display Block.
364
+ acf_register_block(array(
365
+ 'name' => 'acfb-meta-display',
366
+ 'mode' => 'preview',
367
+ 'title' => __('Acf Meta Display'),
368
+ 'description' => __('Add Acf Meta Display in your pages/posts.'),
369
+ 'render_callback' => 'acf_blocks_template',
370
+ 'category' => 'acfb-blocks',
371
+ 'icon' => '<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" viewBox="0 0 512 512"><title>Location</title><path d="M360,153a8,8,0,0,0-8-8H161a8,8,0,0,0-8,8V290a8,8,0,0,0,8,8H352a8,8,0,0,0,8-8Zm-17,8v71.566l-44.125-31.419a7.842,7.842,0,0,0-10.118.823l-36.029,35.466-41.684-20.33a7.527,7.527,0,0,0-7.277.271L169,237.681V161ZM169,256.178l39.122-22.822L240.793,249.2,208.19,281H169ZM231.016,281l64.07-63.062L343,252.173V281Z"/><path d="M245.8,220.424a22.96,22.96,0,1,0-22.96-22.96A22.986,22.986,0,0,0,245.8,220.424Zm0-29.92a6.96,6.96,0,1,1-6.96,6.96A6.968,6.968,0,0,1,245.8,190.5Z"/><path d="M256,9.677c-116.861,0-211.935,91.049-211.935,202.964,0,35.921,11.076,73.539,32.917,111.811,17.261,30.246,41.272,61,71.365,91.4,51.023,51.547,101.231,83.863,103.344,85.213a8,8,0,0,0,8.618,0c2.113-1.35,52.321-33.666,103.344-85.213,30.093-30.4,54.1-61.152,71.365-91.4,21.841-38.272,32.917-75.89,32.917-111.811C467.935,100.726,372.861,9.677,256,9.677Zm165.2,306.7c-16.532,29-39.646,58.609-68.7,87.994A677.751,677.751,0,0,1,256,484.72a677.751,677.751,0,0,1-96.5-80.347c-29.056-29.385-52.17-58.991-68.7-87.994C70.405,280.6,60.065,245.7,60.065,212.641c0-103.092,87.9-186.964,195.935-186.964s195.935,83.872,195.935,186.964C451.935,245.7,441.6,280.6,421.2,316.379Z"/><path d="M256,61.121c-86.511,0-156.893,70.382-156.893,156.893S169.489,374.907,256,374.907s156.893-70.382,156.893-156.893S342.511,61.121,256,61.121Zm0,297.786c-77.688,0-140.893-63.2-140.893-140.893S178.312,77.121,256,77.121s140.893,63.205,140.893,140.893S333.688,358.907,256,358.907Z"/></svg>',
372
+ 'enqueue_assets' => function(){
373
+ wp_enqueue_style( 'acfb-blocks-css', plugin_dir_url( __FILE__ ) . 'css/acfblocks.css' );
374
+ },
375
+ ));
376
+
377
+ add_action('acf/input/admin_enqueue_scripts', function () {
378
+ wp_enqueue_script('acfb-data-js', plugin_dir_url(__FILE__) . 'js/acfdata.js', uniqid(), false);
379
+
380
+ });
381
+
382
 
383
 
384
  }
js/acfdata.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const target_field = "acfb_meta_select_field"; // select box
2
+ const field = acf.getField(target_field);
3
+ acf.addAction(`new_field/name=${target_field}`, (field) => {
4
+ const el = field.$el.find("select");
5
+ const { key } = field.data;
6
+ const defaultValue = window[key];
7
+ const available_fields = acf.getFields();
8
+
9
+
10
+
11
+ el.append(`<option value='Null'>Select Field</option>`);
12
+
13
+
14
+ available_fields.forEach((available_field, index) => {
15
+ const field_name = available_field.data.name;
16
+ const type = available_field.data.type;
17
+ const label = available_field.$el.find("label").html();
18
+ const json_value = {
19
+ name: field_name,
20
+ type,
21
+ };
22
+
23
+ const value = JSON.stringify(json_value);
24
+ const isMetaField =
25
+ available_field.$el.parents(".is-normal,.is-side,.is-above").length > 0;
26
+ const isSelected = defaultValue === value ? 'selected' : '';
27
+
28
+
29
+ const option = `<option ${isSelected} value='${value}'>${label}</option>`;
30
+ // fields name that will be excluded from the select box
31
+ const exceptionalFields = [target_field, "post_id", "acfb_meta_select_field_type"];
32
+
33
+ if (!exceptionalFields.includes(field_name) && isMetaField) {
34
+ el.append(option);
35
+ }
36
+
37
+ // attaching change listener on each field
38
+ });
39
+ });
40
+
41
+ acf.addAction("new_field/name=post_id", (field) => {
42
+ field.$el.hide();
43
+
44
+ const el = field.$el.find("input");
45
+ const postID = acf.get("post_id");
46
+
47
+ el.attr("value", postID);
48
+ });
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Gutenberg Blocks - ACF Blocks Suite ===
2
- Contributors: munirkamal
3
  Tags: block, gutenberg block, acf block, gutenberg, acf, editor
4
  Requires at least: 5.0
5
  Requires PHP: 5.6
6
- Tested up to: 5.4
7
- Stable tag: 2.1.0
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -12,9 +12,9 @@ Supercharge your Gutenberg editor with high-quality creative Gutenberg Blocks. R
12
 
13
  == Description ==
14
 
15
- <strong>ACF Blocks - Ready to use Gutenberg Blocks</strong>
16
 
17
- ACF Blocks is a collection of ready-to-use Gutenberg Blocks for WordPress. Supercharge your Gutenberg editor with high-quality creative WordPress blocks. This Gutenberg addon helps you make a beautiful WordPress website.
18
 
19
  <a href="https://www.acfblocks.com/?utm_source=wp-repo&utm_medium=link&utm_campaign=readme" target="_blank" rel="">Checkout Live ACF Blocks Demos.</a>
20
 
@@ -39,11 +39,12 @@ ACF Blocks is a collection of ready-to-use Gutenberg Blocks for WordPress. Super
39
  <li>Click to tweet Block</li>
40
  <li>Business Hours Block</li>
41
  <li>Facebook Page Block</li>
 
42
  </ol>
43
 
44
- == ACF Blocks Pro Brings More Power ==
45
 
46
- ACF Blocks Pro is here. It brings more amazing Gutenberg blocks to the free plugin (which will also continue to get better) and power it up with features that make it the best #ACFBlocks plugin. You will also get premium support with the Pro.
47
 
48
  Have a Sneak-peek to ACF Pro Blocks.
49
 
@@ -139,6 +140,10 @@ Absolutely! You can definitely use the ACF Blocks on yours as well as your clien
139
 
140
  == Changelog ==
141
 
 
 
 
 
142
  = 2.1.0 =
143
  * Added Facebook Page (Free)
144
  * Added Tilt Image (Pro)
1
  === Gutenberg Blocks - ACF Blocks Suite ===
2
+ Contributors: munirkamal, freemius
3
  Tags: block, gutenberg block, acf block, gutenberg, acf, editor
4
  Requires at least: 5.0
5
  Requires PHP: 5.6
6
+ Tested up to: 5.5
7
+ Stable tag: 2.2.0
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
12
 
13
  == Description ==
14
 
15
+ <strong>ACF Blocks Suite - Ready to use Gutenberg Blocks</strong>
16
 
17
+ ACF Blocks Suite is a collection of ready-to-use Gutenberg Blocks for WordPress. Supercharge your Gutenberg editor with high-quality creative WordPress blocks. This Gutenberg addon helps you make a beautiful WordPress website.
18
 
19
  <a href="https://www.acfblocks.com/?utm_source=wp-repo&utm_medium=link&utm_campaign=readme" target="_blank" rel="">Checkout Live ACF Blocks Demos.</a>
20
 
39
  <li>Click to tweet Block</li>
40
  <li>Business Hours Block</li>
41
  <li>Facebook Page Block</li>
42
+ <li>Acf Meta Display Block</li>
43
  </ol>
44
 
45
+ == ACF Blocks Suite Pro Brings More Power ==
46
 
47
+ ACF Blocks Suite Pro is here. It brings more amazing Gutenberg blocks to the free plugin (which will also continue to get better) and power it up with features that make it the best #ACFBlocksSuite plugin. You will also get premium support with the Pro.
48
 
49
  Have a Sneak-peek to ACF Pro Blocks.
50
 
140
 
141
  == Changelog ==
142
 
143
+ = 2.2.0 =
144
+ * Added Acf Meta Display Block (Free)
145
+ * Bug Fixes
146
+
147
  = 2.1.0 =
148
  * Added Facebook Page (Free)
149
  * Added Tilt Image (Pro)