Gutenberg Blocks – ACF Blocks Suite - Version 1.1.0

Version Description

  • New: Posts Block Added
  • ACF Api Updates.
Download this release

Release Info

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

Code changes from version 1.0.0 to 1.1.0

acf-blocks.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: ACF Blocks
4
  * Plugin URI: https://acfblocks.com/
5
  * Description: Supercharge your Gutenberg editor with high quality beautiful WordPress blocks. Ready-to-use ACF Blocks!
6
- * Version: 1.0.0
7
  * Author: munirkamal
8
  * Author URI: https://munirkamal.wordpress.com
9
  * License: GPL2
@@ -68,10 +68,10 @@ add_action('acf/init', 'acfb_blocks');
68
  function acfb_blocks() {
69
 
70
  // check function exists.
71
- if( function_exists('acf_register_block') ) {
72
 
73
  // register a testimonial block.
74
- acf_register_block(array(
75
  'name' => 'acfb-testimonial',
76
  'mode' => 'preview',
77
  'title' => __('Testimonial'),
@@ -85,7 +85,7 @@ function acfb_blocks() {
85
  ));
86
 
87
  // register a team block.
88
- acf_register_block(array(
89
  'name' => 'acfb-team',
90
  'mode' => 'preview',
91
  'title' => __('Team'),
@@ -99,7 +99,7 @@ function acfb_blocks() {
99
  ));
100
 
101
  // register a multi buttons block.
102
- acf_register_block(array(
103
  'name' => 'acfb-multibuttons',
104
  'mode' => 'preview',
105
  'title' => __('Multi Buttons'),
@@ -113,7 +113,7 @@ function acfb_blocks() {
113
  ));
114
 
115
  // register a pricing box block.
116
- acf_register_block(array(
117
  'name' => 'acfb-pricingbox',
118
  'mode' => 'preview',
119
  'title' => __('Pricing Box'),
@@ -127,7 +127,7 @@ function acfb_blocks() {
127
  ));
128
 
129
  // register a Star Rating block.
130
- acf_register_block(array(
131
  'name' => 'acfb-starrating',
132
  'mode' => 'preview',
133
  'title' => __('Star Rating'),
@@ -141,7 +141,7 @@ function acfb_blocks() {
141
  ));
142
 
143
  // register a Progress Bar block.
144
- acf_register_block(array(
145
  'name' => 'acfb-progressbar',
146
  'mode' => 'preview',
147
  'title' => __('Progress Bar'),
@@ -157,7 +157,7 @@ function acfb_blocks() {
157
  ));
158
 
159
  // register a Counter Number block.
160
- acf_register_block(array(
161
  'name' => 'acfb-counternumber',
162
  'mode' => 'preview',
163
  'title' => __('Counter Number'),
@@ -172,7 +172,7 @@ function acfb_blocks() {
172
  ));
173
 
174
  // register a Price List block.
175
- acf_register_block(array(
176
  'name' => 'acfb-pricelist',
177
  'mode' => 'preview',
178
  'title' => __('Price List'),
@@ -186,7 +186,7 @@ function acfb_blocks() {
186
  ));
187
 
188
  // register a Click To Tweet block.
189
- acf_register_block(array(
190
  'name' => 'acfb-clicktotweet',
191
  'mode' => 'preview',
192
  'title' => __('Click To Tweet'),
@@ -201,12 +201,34 @@ function acfb_blocks() {
201
  },
202
  ));
203
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  }
205
  }
206
 
207
 
208
 
209
-
210
  add_filter('acf/settings/save_json', 'acfb_json_save_point');
211
  function acfb_json_save_point( $acfb_path ) {
212
 
@@ -219,6 +241,7 @@ function acfb_json_save_point( $acfb_path ) {
219
  }
220
 
221
 
 
222
  add_filter('acf/settings/load_json', 'acfb_json_load_point');
223
  function acfb_json_load_point( $acfb_path ) {
224
 
@@ -233,3 +256,77 @@ function acfb_json_load_point( $acfb_path ) {
233
 
234
  }
235
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  * Plugin Name: ACF Blocks
4
  * Plugin URI: https://acfblocks.com/
5
  * Description: Supercharge your Gutenberg editor with high quality beautiful WordPress blocks. Ready-to-use ACF Blocks!
6
+ * Version: 1.1.0
7
  * Author: munirkamal
8
  * Author URI: https://munirkamal.wordpress.com
9
  * License: GPL2
68
  function acfb_blocks() {
69
 
70
  // check function exists.
71
+ if( function_exists('acf_register_block_type') ) {
72
 
73
  // register a testimonial block.
74
+ acf_register_block_type(array(
75
  'name' => 'acfb-testimonial',
76
  'mode' => 'preview',
77
  'title' => __('Testimonial'),
85
  ));
86
 
87
  // register a team block.
88
+ acf_register_block_type(array(
89
  'name' => 'acfb-team',
90
  'mode' => 'preview',
91
  'title' => __('Team'),
99
  ));
100
 
101
  // register a multi buttons block.
102
+ acf_register_block_type(array(
103
  'name' => 'acfb-multibuttons',
104
  'mode' => 'preview',
105
  'title' => __('Multi Buttons'),
113
  ));
114
 
115
  // register a pricing box block.
116
+ acf_register_block_type(array(
117
  'name' => 'acfb-pricingbox',
118
  'mode' => 'preview',
119
  'title' => __('Pricing Box'),
127
  ));
128
 
129
  // register a Star Rating block.
130
+ acf_register_block_type(array(
131
  'name' => 'acfb-starrating',
132
  'mode' => 'preview',
133
  'title' => __('Star Rating'),
141
  ));
142
 
143
  // register a Progress Bar block.
144
+ acf_register_block_type(array(
145
  'name' => 'acfb-progressbar',
146
  'mode' => 'preview',
147
  'title' => __('Progress Bar'),
157
  ));
158
 
159
  // register a Counter Number block.
160
+ acf_register_block_type(array(
161
  'name' => 'acfb-counternumber',
162
  'mode' => 'preview',
163
  'title' => __('Counter Number'),
172
  ));
173
 
174
  // register a Price List block.
175
+ acf_register_block_type(array(
176
  'name' => 'acfb-pricelist',
177
  'mode' => 'preview',
178
  'title' => __('Price List'),
186
  ));
187
 
188
  // register a Click To Tweet block.
189
+ acf_register_block_type(array(
190
  'name' => 'acfb-clicktotweet',
191
  'mode' => 'preview',
192
  'title' => __('Click To Tweet'),
201
  },
202
  ));
203
 
204
+
205
+ // register a Post block.
206
+ acf_register_block_type(array(
207
+ 'name' => 'acfb-posts',
208
+ 'mode' => 'preview',
209
+ 'title' => __('Posts'),
210
+ 'description' => __('Display a grid or list of your blog posts.'),
211
+ 'render_template' => plugin_dir_path( __FILE__ ) . 'block-templates/posts.php',
212
+ 'category' => 'acfb-blocks',
213
+ 'icon' => '<svg enable-background="new 0 0 512 512" version="1.1" viewBox="0 0 512 512" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
214
+ <path d="M0,30v452h512V30H0z M482,452H30V120h452V452z M482,90H30V60h452V90z"/>
215
+ <path d="M271,160v252h181V160H271z M422,382H301V190h121V382z"/>
216
+ <rect x="60" y="160" width="181" height="30"/>
217
+ <rect x="60" y="220" width="121" height="30"/>
218
+ <rect x="60" y="300" width="181" height="30"/>
219
+ <rect x="60" y="360" width="121" height="30"/>
220
+ </svg>',
221
+ 'enqueue_assets' => function(){
222
+ wp_enqueue_style( 'acfb-blocks-css', plugin_dir_url( __FILE__ ) . 'css/acfblocks.css' );
223
+ },
224
+ ));
225
+
226
  }
227
  }
228
 
229
 
230
 
231
+ // Save Acf
232
  add_filter('acf/settings/save_json', 'acfb_json_save_point');
233
  function acfb_json_save_point( $acfb_path ) {
234
 
241
  }
242
 
243
 
244
+ // Load Acf
245
  add_filter('acf/settings/load_json', 'acfb_json_load_point');
246
  function acfb_json_load_point( $acfb_path ) {
247
 
256
 
257
  }
258
 
259
+
260
+
261
+
262
+ // Excerpt Limit
263
+ function acfb_excerpt($acfb_excerpt_limit) {
264
+ $acfb_excerpt = explode(' ', get_the_excerpt(), $acfb_excerpt_limit);
265
+ if (count($acfb_excerpt)>=$acfb_excerpt_limit) {
266
+ array_pop($acfb_excerpt);
267
+ $acfb_excerpt = implode(" ",$acfb_excerpt).'...';
268
+ } else {
269
+ $acfb_excerpt = implode(" ",$acfb_excerpt);
270
+ }
271
+ $acfb_excerpt = preg_replace('`[[^]]*]`','',$acfb_excerpt);
272
+ return $acfb_excerpt;
273
+ }
274
+
275
+
276
+
277
+
278
+ // Default Value in post List Elements
279
+ add_filter('acf/load_value/name=acfb_post_list_elements', 'acfb_post_list_elements_defaults', 10, 3);
280
+ function acfb_post_list_elements_defaults($value, $post_id, $field) {
281
+ if ($value !== NULL) {
282
+ // $value will only be NULL on a new post
283
+ return $value;
284
+ }
285
+ // add default layouts
286
+ $value = array(
287
+ array(
288
+ 'acf_fc_layout' => 'post_list_title'
289
+ ),
290
+ array(
291
+ 'acf_fc_layout' => 'post_list_meta_data'
292
+ ),
293
+ array(
294
+ 'acf_fc_layout' => 'post_list_content'
295
+ ),
296
+ array(
297
+ 'acf_fc_layout' => 'post_list_read_more_button'
298
+ )
299
+ );
300
+ return $value;
301
+
302
+ }
303
+
304
+
305
+
306
+ // Default Value in post Grid Elements
307
+ add_filter('acf/load_value/name=acfb_post_grid_elements', 'acfb_post_grid_elements_defaults', 10, 3);
308
+ function acfb_post_grid_elements_defaults($value, $post_id, $field) {
309
+ if ($value !== NULL) {
310
+ // $value will only be NULL on a new post
311
+ return $value;
312
+ }
313
+ // add default layouts
314
+ $value = array(
315
+ array(
316
+ 'acf_fc_layout' => 'post_grid_image'
317
+ ),
318
+ array(
319
+ 'acf_fc_layout' => 'post_grid_title'
320
+ ),
321
+ array(
322
+ 'acf_fc_layout' => 'post_grid_meta_data'
323
+ ),
324
+ array(
325
+ 'acf_fc_layout' => 'post_grid_content'
326
+ ),
327
+ array(
328
+ 'acf_fc_layout' => 'post_grid_read_more_button'
329
+ )
330
+ );
331
+ return $value;
332
+ }
acf-json/group_5cbd743876860.json CHANGED
@@ -1,7 +1,6 @@
1
  {
2
  "key": "group_5cbd743876860",
3
  "title": "Testimonials Block",
4
- "private" : true,
5
  "fields": [
6
  {
7
  "key": "field_5cc81f63ae3fb",
@@ -121,7 +120,7 @@
121
  },
122
  {
123
  "key": "field_5cc81fc1ae3fc",
124
- "label": "Style",
125
  "name": "",
126
  "type": "tab",
127
  "instructions": "",
@@ -293,5 +292,5 @@
293
  "hide_on_screen": "",
294
  "active": 1,
295
  "description": "",
296
- "modified": 1556892181
297
  }
1
  {
2
  "key": "group_5cbd743876860",
3
  "title": "Testimonials Block",
 
4
  "fields": [
5
  {
6
  "key": "field_5cc81f63ae3fb",
120
  },
121
  {
122
  "key": "field_5cc81fc1ae3fc",
123
+ "label": "Design",
124
  "name": "",
125
  "type": "tab",
126
  "instructions": "",
292
  "hide_on_screen": "",
293
  "active": 1,
294
  "description": "",
295
+ "modified": 1557732899
296
  }
acf-json/group_5cbd9e696a100.json CHANGED
@@ -1,7 +1,6 @@
1
  {
2
  "key": "group_5cbd9e696a100",
3
  "title": "Team Block",
4
- "private" : true,
5
  "fields": [
6
  {
7
  "key": "field_5cc828ec4ea06",
@@ -148,7 +147,7 @@
148
  },
149
  {
150
  "key": "field_5cc8292d4ea07",
151
- "label": "Style",
152
  "name": "",
153
  "type": "tab",
154
  "instructions": "",
@@ -320,5 +319,5 @@
320
  "hide_on_screen": "",
321
  "active": 1,
322
  "description": "",
323
- "modified": 1556892184
324
  }
1
  {
2
  "key": "group_5cbd9e696a100",
3
  "title": "Team Block",
 
4
  "fields": [
5
  {
6
  "key": "field_5cc828ec4ea06",
147
  },
148
  {
149
  "key": "field_5cc8292d4ea07",
150
+ "label": "Design",
151
  "name": "",
152
  "type": "tab",
153
  "instructions": "",
319
  "hide_on_screen": "",
320
  "active": 1,
321
  "description": "",
322
+ "modified": 1557732904
323
  }
acf-json/group_5cbdba3909312.json CHANGED
@@ -1,7 +1,6 @@
1
  {
2
  "key": "group_5cbdba3909312",
3
  "title": "Multi Buttons",
4
- "private" : true,
5
  "fields": [
6
  {
7
  "key": "field_5cc84ecff7cb8",
@@ -137,7 +136,7 @@
137
  },
138
  {
139
  "key": "field_5cc84ee0f7cb9",
140
- "label": "Style",
141
  "name": "",
142
  "type": "tab",
143
  "instructions": "",
@@ -189,5 +188,5 @@
189
  "hide_on_screen": "",
190
  "active": 1,
191
  "description": "",
192
- "modified": 1556892229
193
  }
1
  {
2
  "key": "group_5cbdba3909312",
3
  "title": "Multi Buttons",
 
4
  "fields": [
5
  {
6
  "key": "field_5cc84ecff7cb8",
136
  },
137
  {
138
  "key": "field_5cc84ee0f7cb9",
139
+ "label": "Design",
140
  "name": "",
141
  "type": "tab",
142
  "instructions": "",
188
  "hide_on_screen": "",
189
  "active": 1,
190
  "description": "",
191
+ "modified": 1557732944
192
  }
acf-json/group_5cbdd1a0caf81.json CHANGED
@@ -1,7 +1,6 @@
1
  {
2
  "key": "group_5cbdd1a0caf81",
3
  "title": "Pricing Box",
4
- "private" : true,
5
  "fields": [
6
  {
7
  "key": "field_5cc840c7667b5",
@@ -214,7 +213,7 @@
214
  },
215
  {
216
  "key": "field_5cc840de667b6",
217
- "label": "Style",
218
  "name": "",
219
  "type": "tab",
220
  "instructions": "",
@@ -571,5 +570,5 @@
571
  "hide_on_screen": "",
572
  "active": 1,
573
  "description": "",
574
- "modified": 1556892198
575
  }
1
  {
2
  "key": "group_5cbdd1a0caf81",
3
  "title": "Pricing Box",
 
4
  "fields": [
5
  {
6
  "key": "field_5cc840c7667b5",
213
  },
214
  {
215
  "key": "field_5cc840de667b6",
216
+ "label": "Design",
217
  "name": "",
218
  "type": "tab",
219
  "instructions": "",
570
  "hide_on_screen": "",
571
  "active": 1,
572
  "description": "",
573
+ "modified": 1557732909
574
  }
acf-json/group_5cc04e691b1a8.json CHANGED
@@ -1,7 +1,6 @@
1
  {
2
  "key": "group_5cc04e691b1a8",
3
  "title": "Star Rating",
4
- "private" : true,
5
  "fields": [
6
  {
7
  "key": "field_5cc8304dcc37e",
@@ -60,7 +59,7 @@
60
  },
61
  {
62
  "key": "field_5cc83066cc37f",
63
- "label": "Style",
64
  "name": "",
65
  "type": "tab",
66
  "instructions": "",
@@ -197,5 +196,5 @@
197
  "hide_on_screen": "",
198
  "active": 1,
199
  "description": "",
200
- "modified": 1556892185
201
  }
1
  {
2
  "key": "group_5cc04e691b1a8",
3
  "title": "Star Rating",
 
4
  "fields": [
5
  {
6
  "key": "field_5cc8304dcc37e",
59
  },
60
  {
61
  "key": "field_5cc83066cc37f",
62
+ "label": "Design",
63
  "name": "",
64
  "type": "tab",
65
  "instructions": "",
196
  "hide_on_screen": "",
197
  "active": 1,
198
  "description": "",
199
+ "modified": 1557732907
200
  }
acf-json/group_5cc6b8e86e751.json CHANGED
@@ -1,7 +1,6 @@
1
  {
2
  "key": "group_5cc6b8e86e751",
3
  "title": "Progress Bar",
4
- "private" : true,
5
  "fields": [
6
  {
7
  "key": "field_5cc835ec452d9",
@@ -98,7 +97,7 @@
98
  },
99
  {
100
  "key": "field_5cc838e1452da",
101
- "label": "Style",
102
  "name": "",
103
  "type": "tab",
104
  "instructions": "",
@@ -230,5 +229,5 @@
230
  "hide_on_screen": "",
231
  "active": 1,
232
  "description": "",
233
- "modified": 1556892197
234
  }
1
  {
2
  "key": "group_5cc6b8e86e751",
3
  "title": "Progress Bar",
 
4
  "fields": [
5
  {
6
  "key": "field_5cc835ec452d9",
97
  },
98
  {
99
  "key": "field_5cc838e1452da",
100
+ "label": "Design",
101
  "name": "",
102
  "type": "tab",
103
  "instructions": "",
229
  "hide_on_screen": "",
230
  "active": 1,
231
  "description": "",
232
+ "modified": 1557732908
233
  }
acf-json/group_5cc6cf92e231a.json CHANGED
@@ -1,7 +1,6 @@
1
  {
2
  "key": "group_5cc6cf92e231a",
3
  "title": "Counter Number",
4
- "private" : true,
5
  "fields": [
6
  {
7
  "key": "field_5cc855022aabc",
@@ -99,7 +98,7 @@
99
  },
100
  {
101
  "key": "field_5cc855162aabd",
102
- "label": "Style",
103
  "name": "",
104
  "type": "tab",
105
  "instructions": "",
@@ -201,5 +200,5 @@
201
  "hide_on_screen": "",
202
  "active": 1,
203
  "description": "",
204
- "modified": 1556892230
205
  }
1
  {
2
  "key": "group_5cc6cf92e231a",
3
  "title": "Counter Number",
 
4
  "fields": [
5
  {
6
  "key": "field_5cc855022aabc",
98
  },
99
  {
100
  "key": "field_5cc855162aabd",
101
+ "label": "Design",
102
  "name": "",
103
  "type": "tab",
104
  "instructions": "",
200
  "hide_on_screen": "",
201
  "active": 1,
202
  "description": "",
203
+ "modified": 1557732945
204
  }
acf-json/group_5cc6dfe67784b.json CHANGED
@@ -1,7 +1,6 @@
1
  {
2
  "key": "group_5cc6dfe67784b",
3
  "title": "Price List",
4
- "private" : true,
5
  "fields": [
6
  {
7
  "key": "field_5cc849708d41e",
@@ -161,7 +160,7 @@
161
  },
162
  {
163
  "key": "field_5cc849a38d41f",
164
- "label": "Style",
165
  "name": "",
166
  "type": "tab",
167
  "instructions": "",
@@ -328,5 +327,5 @@
328
  "hide_on_screen": "",
329
  "active": 1,
330
  "description": "",
331
- "modified": 1556892200
332
  }
1
  {
2
  "key": "group_5cc6dfe67784b",
3
  "title": "Price List",
 
4
  "fields": [
5
  {
6
  "key": "field_5cc849708d41e",
160
  },
161
  {
162
  "key": "field_5cc849a38d41f",
163
+ "label": "Design",
164
  "name": "",
165
  "type": "tab",
166
  "instructions": "",
327
  "hide_on_screen": "",
328
  "active": 1,
329
  "description": "",
330
+ "modified": 1557732983
331
  }
acf-json/group_5cc7092c01eb4.json CHANGED
@@ -1,7 +1,6 @@
1
  {
2
  "key": "group_5cc7092c01eb4",
3
  "title": "Click To Tweet",
4
- "private" : true,
5
  "fields": [
6
  {
7
  "key": "field_5cc859c489bde",
@@ -78,7 +77,7 @@
78
  },
79
  {
80
  "key": "field_5cc859d789bdf",
81
- "label": "Style",
82
  "name": "",
83
  "type": "tab",
84
  "instructions": "",
@@ -210,5 +209,5 @@
210
  "hide_on_screen": "",
211
  "active": 1,
212
  "description": "",
213
- "modified": 1556892233
214
  }
1
  {
2
  "key": "group_5cc7092c01eb4",
3
  "title": "Click To Tweet",
 
4
  "fields": [
5
  {
6
  "key": "field_5cc859c489bde",
77
  },
78
  {
79
  "key": "field_5cc859d789bdf",
80
+ "label": "Design",
81
  "name": "",
82
  "type": "tab",
83
  "instructions": "",
209
  "hide_on_screen": "",
210
  "active": 1,
211
  "description": "",
212
+ "modified": 1557732946
213
  }
acf-json/group_5cd00bce35670.json ADDED
@@ -0,0 +1,717 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "key": "group_5cd00bce35670",
3
+ "title": "Posts",
4
+ "fields": [
5
+ {
6
+ "key": "field_5cd3f78c914d2",
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_5cd2c9c51f0f8",
23
+ "label": "Select a Layout",
24
+ "name": "acfb_posts_layout",
25
+ "type": "button_group",
26
+ "instructions": "",
27
+ "required": 0,
28
+ "conditional_logic": 0,
29
+ "wrapper": {
30
+ "width": "",
31
+ "class": "",
32
+ "id": ""
33
+ },
34
+ "choices": {
35
+ "list": "<span class=\"dashicons dashicons-excerpt-view\"><\/span> List",
36
+ "grid": "<span class=\"dashicons dashicons-grid-view\"><\/span> Grid"
37
+ },
38
+ "allow_null": 0,
39
+ "default_value": "list",
40
+ "layout": "horizontal",
41
+ "return_format": "value"
42
+ },
43
+ {
44
+ "key": "field_5cd6ad1a1d747",
45
+ "label": "Filter By Categories",
46
+ "name": "acfb_category_filters",
47
+ "type": "taxonomy",
48
+ "instructions": "",
49
+ "required": 0,
50
+ "conditional_logic": 0,
51
+ "wrapper": {
52
+ "width": "",
53
+ "class": "",
54
+ "id": ""
55
+ },
56
+ "taxonomy": "category",
57
+ "field_type": "multi_select",
58
+ "allow_null": 0,
59
+ "add_term": 0,
60
+ "save_terms": 0,
61
+ "load_terms": 0,
62
+ "return_format": "id",
63
+ "multiple": 0
64
+ },
65
+ {
66
+ "key": "field_5cd523389c6ad",
67
+ "label": "Post List Elements",
68
+ "name": "acfb_post_list_elements",
69
+ "type": "flexible_content",
70
+ "instructions": "",
71
+ "required": 0,
72
+ "conditional_logic": [
73
+ [
74
+ {
75
+ "field": "field_5cd2c9c51f0f8",
76
+ "operator": "==",
77
+ "value": "list"
78
+ }
79
+ ]
80
+ ],
81
+ "wrapper": {
82
+ "width": "",
83
+ "class": "",
84
+ "id": ""
85
+ },
86
+ "layouts": {
87
+ "layout_5cd3e15f431ae": {
88
+ "key": "layout_5cd3e15f431ae",
89
+ "name": "post_list_title",
90
+ "label": "Title",
91
+ "display": "block",
92
+ "sub_fields": [],
93
+ "min": "1",
94
+ "max": "1"
95
+ },
96
+ "layout_5cd40088e4c2e": {
97
+ "key": "layout_5cd40088e4c2e",
98
+ "name": "post_list_meta_data",
99
+ "label": "Meta Data",
100
+ "display": "block",
101
+ "sub_fields": [],
102
+ "min": "1",
103
+ "max": "1"
104
+ },
105
+ "layout_5cd3e2cb3fc27": {
106
+ "key": "layout_5cd3e2cb3fc27",
107
+ "name": "post_list_content",
108
+ "label": "Content",
109
+ "display": "block",
110
+ "sub_fields": [],
111
+ "min": "1",
112
+ "max": "1"
113
+ },
114
+ "layout_5cd3fc02f65a2": {
115
+ "key": "layout_5cd3fc02f65a2",
116
+ "name": "post_list_read_more_button",
117
+ "label": "Read More Button",
118
+ "display": "block",
119
+ "sub_fields": [],
120
+ "min": "1",
121
+ "max": "1"
122
+ }
123
+ },
124
+ "button_label": "Add Post Element",
125
+ "min": "",
126
+ "max": ""
127
+ },
128
+ {
129
+ "key": "field_5cd3e14451e15",
130
+ "label": "Post Grid Elements",
131
+ "name": "acfb_post_grid_elements",
132
+ "type": "flexible_content",
133
+ "instructions": "",
134
+ "required": 0,
135
+ "conditional_logic": [
136
+ [
137
+ {
138
+ "field": "field_5cd2c9c51f0f8",
139
+ "operator": "==",
140
+ "value": "grid"
141
+ }
142
+ ]
143
+ ],
144
+ "wrapper": {
145
+ "width": "",
146
+ "class": "",
147
+ "id": ""
148
+ },
149
+ "layouts": {
150
+ "layout_5cd3e2913fc26": {
151
+ "key": "layout_5cd3e2913fc26",
152
+ "name": "post_grid_image",
153
+ "label": "Image",
154
+ "display": "block",
155
+ "sub_fields": [],
156
+ "min": "1",
157
+ "max": "1"
158
+ },
159
+ "layout_5cd3e15f431ae": {
160
+ "key": "layout_5cd3e15f431ae",
161
+ "name": "post_grid_title",
162
+ "label": "Title",
163
+ "display": "block",
164
+ "sub_fields": [],
165
+ "min": "1",
166
+ "max": "1"
167
+ },
168
+ "layout_5cd40088e4c2e": {
169
+ "key": "layout_5cd40088e4c2e",
170
+ "name": "post_grid_meta_data",
171
+ "label": "Meta Data",
172
+ "display": "block",
173
+ "sub_fields": [],
174
+ "min": "1",
175
+ "max": "1"
176
+ },
177
+ "layout_5cd3e2cb3fc27": {
178
+ "key": "layout_5cd3e2cb3fc27",
179
+ "name": "post_grid_content",
180
+ "label": "Content",
181
+ "display": "block",
182
+ "sub_fields": [],
183
+ "min": "1",
184
+ "max": "1"
185
+ },
186
+ "layout_5cd3fc02f65a2": {
187
+ "key": "layout_5cd3fc02f65a2",
188
+ "name": "post_grid_read_more_button",
189
+ "label": "Post Read More Button",
190
+ "display": "block",
191
+ "sub_fields": [],
192
+ "min": "1",
193
+ "max": "1"
194
+ }
195
+ },
196
+ "button_label": "Add Post Element",
197
+ "min": "",
198
+ "max": ""
199
+ },
200
+ {
201
+ "key": "field_5cd40486f6e7b",
202
+ "label": "Title HTML Tag",
203
+ "name": "acfb_post_title_html_tag",
204
+ "type": "button_group",
205
+ "instructions": "",
206
+ "required": 0,
207
+ "conditional_logic": 0,
208
+ "wrapper": {
209
+ "width": "",
210
+ "class": "",
211
+ "id": ""
212
+ },
213
+ "choices": {
214
+ "h1": "H1",
215
+ "h2": "H2",
216
+ "h3": "H3",
217
+ "h4": "H4",
218
+ "h5": "H5",
219
+ "h6": "H6"
220
+ },
221
+ "allow_null": 0,
222
+ "default_value": "h3",
223
+ "layout": "horizontal",
224
+ "return_format": "value"
225
+ },
226
+ {
227
+ "key": "field_5cd2c6462b8ae",
228
+ "label": "Number of Posts",
229
+ "name": "acfb_number_of_posts",
230
+ "type": "range",
231
+ "instructions": "",
232
+ "required": 0,
233
+ "conditional_logic": 0,
234
+ "wrapper": {
235
+ "width": "",
236
+ "class": "",
237
+ "id": ""
238
+ },
239
+ "default_value": 2,
240
+ "min": 1,
241
+ "max": "",
242
+ "step": "",
243
+ "prepend": "",
244
+ "append": ""
245
+ },
246
+ {
247
+ "key": "field_5cd2c66b2b8af",
248
+ "label": "Columns",
249
+ "name": "acfb_posts_columns",
250
+ "type": "range",
251
+ "instructions": "",
252
+ "required": 0,
253
+ "conditional_logic": [
254
+ [
255
+ {
256
+ "field": "field_5cd2c9c51f0f8",
257
+ "operator": "==",
258
+ "value": "grid"
259
+ }
260
+ ]
261
+ ],
262
+ "wrapper": {
263
+ "width": "",
264
+ "class": "",
265
+ "id": ""
266
+ },
267
+ "default_value": 2,
268
+ "min": 2,
269
+ "max": 6,
270
+ "step": "",
271
+ "prepend": "",
272
+ "append": ""
273
+ },
274
+ {
275
+ "key": "field_5cd3fbb7f65a1",
276
+ "label": "Excerpt Length",
277
+ "name": "acfb_post_excerpt_length",
278
+ "type": "number",
279
+ "instructions": "",
280
+ "required": 0,
281
+ "conditional_logic": 0,
282
+ "wrapper": {
283
+ "width": "",
284
+ "class": "",
285
+ "id": ""
286
+ },
287
+ "default_value": 20,
288
+ "placeholder": "",
289
+ "prepend": "",
290
+ "append": "",
291
+ "min": "",
292
+ "max": "",
293
+ "step": ""
294
+ },
295
+ {
296
+ "key": "field_5cd3f7e4914d3",
297
+ "label": "Design",
298
+ "name": "",
299
+ "type": "tab",
300
+ "instructions": "",
301
+ "required": 0,
302
+ "conditional_logic": 0,
303
+ "wrapper": {
304
+ "width": "",
305
+ "class": "",
306
+ "id": ""
307
+ },
308
+ "placement": "top",
309
+ "endpoint": 0
310
+ },
311
+ {
312
+ "key": "field_5cd3f812914d4",
313
+ "label": "Background Color",
314
+ "name": "acfb_post_background_color",
315
+ "type": "color_picker",
316
+ "instructions": "",
317
+ "required": 0,
318
+ "conditional_logic": 0,
319
+ "wrapper": {
320
+ "width": "",
321
+ "class": "",
322
+ "id": ""
323
+ },
324
+ "default_value": "#f3f4f5"
325
+ },
326
+ {
327
+ "key": "field_5cd68bf596878",
328
+ "label": "Title Custom Styles",
329
+ "name": "acfb_post_title_custom_styles",
330
+ "type": "true_false",
331
+ "instructions": "",
332
+ "required": 0,
333
+ "conditional_logic": 0,
334
+ "wrapper": {
335
+ "width": "",
336
+ "class": "",
337
+ "id": ""
338
+ },
339
+ "message": "",
340
+ "default_value": 0,
341
+ "ui": 1,
342
+ "ui_on_text": "",
343
+ "ui_off_text": ""
344
+ },
345
+ {
346
+ "key": "field_5cd40e5df6b13",
347
+ "label": "Title Color",
348
+ "name": "acfb_post_title_color",
349
+ "type": "color_picker",
350
+ "instructions": "",
351
+ "required": 0,
352
+ "conditional_logic": [
353
+ [
354
+ {
355
+ "field": "field_5cd68bf596878",
356
+ "operator": "==",
357
+ "value": "1"
358
+ }
359
+ ]
360
+ ],
361
+ "wrapper": {
362
+ "width": "",
363
+ "class": "",
364
+ "id": ""
365
+ },
366
+ "default_value": "#191e23"
367
+ },
368
+ {
369
+ "key": "field_5cd4184a5d816",
370
+ "label": "Title Hover Color",
371
+ "name": "acfb_post_title_hover_color",
372
+ "type": "color_picker",
373
+ "instructions": "",
374
+ "required": 0,
375
+ "conditional_logic": [
376
+ [
377
+ {
378
+ "field": "field_5cd68bf596878",
379
+ "operator": "==",
380
+ "value": "1"
381
+ }
382
+ ]
383
+ ],
384
+ "wrapper": {
385
+ "width": "",
386
+ "class": "",
387
+ "id": ""
388
+ },
389
+ "default_value": "#191e23"
390
+ },
391
+ {
392
+ "key": "field_5cd40de2f6b12",
393
+ "label": "Title Size",
394
+ "name": "acfb_post_title_size",
395
+ "type": "range",
396
+ "instructions": "",
397
+ "required": 0,
398
+ "conditional_logic": [
399
+ [
400
+ {
401
+ "field": "field_5cd68bf596878",
402
+ "operator": "==",
403
+ "value": "1"
404
+ }
405
+ ]
406
+ ],
407
+ "wrapper": {
408
+ "width": "",
409
+ "class": "",
410
+ "id": ""
411
+ },
412
+ "default_value": 25,
413
+ "min": "",
414
+ "max": 100,
415
+ "step": "",
416
+ "prepend": "",
417
+ "append": "px"
418
+ },
419
+ {
420
+ "key": "field_5cd68d0464050",
421
+ "label": "Meta Custom Styles",
422
+ "name": "acfb_post_meta_custom_styles",
423
+ "type": "true_false",
424
+ "instructions": "",
425
+ "required": 0,
426
+ "conditional_logic": 0,
427
+ "wrapper": {
428
+ "width": "",
429
+ "class": "",
430
+ "id": ""
431
+ },
432
+ "message": "",
433
+ "default_value": 0,
434
+ "ui": 1,
435
+ "ui_on_text": "",
436
+ "ui_off_text": ""
437
+ },
438
+ {
439
+ "key": "field_5cd40ea3f6b15",
440
+ "label": "Meta Color",
441
+ "name": "acfb_post_meta_color",
442
+ "type": "color_picker",
443
+ "instructions": "",
444
+ "required": 0,
445
+ "conditional_logic": [
446
+ [
447
+ {
448
+ "field": "field_5cd68d0464050",
449
+ "operator": "==",
450
+ "value": "1"
451
+ }
452
+ ]
453
+ ],
454
+ "wrapper": {
455
+ "width": "",
456
+ "class": "",
457
+ "id": ""
458
+ },
459
+ "default_value": "rgba(25, 30, 35, 0.5)"
460
+ },
461
+ {
462
+ "key": "field_5cd40e77f6b14",
463
+ "label": "Meta Size",
464
+ "name": "acfb_post_meta_size",
465
+ "type": "range",
466
+ "instructions": "",
467
+ "required": 0,
468
+ "conditional_logic": [
469
+ [
470
+ {
471
+ "field": "field_5cd68d0464050",
472
+ "operator": "==",
473
+ "value": "1"
474
+ }
475
+ ]
476
+ ],
477
+ "wrapper": {
478
+ "width": "",
479
+ "class": "",
480
+ "id": ""
481
+ },
482
+ "default_value": 16,
483
+ "min": "",
484
+ "max": "",
485
+ "step": "",
486
+ "prepend": "",
487
+ "append": "px"
488
+ },
489
+ {
490
+ "key": "field_5cd68d5164051",
491
+ "label": "Excerpt Custom Styles",
492
+ "name": "acfb_post_excerpt_custom_styles",
493
+ "type": "true_false",
494
+ "instructions": "",
495
+ "required": 0,
496
+ "conditional_logic": 0,
497
+ "wrapper": {
498
+ "width": "",
499
+ "class": "",
500
+ "id": ""
501
+ },
502
+ "message": "",
503
+ "default_value": 0,
504
+ "ui": 1,
505
+ "ui_on_text": "",
506
+ "ui_off_text": ""
507
+ },
508
+ {
509
+ "key": "field_5cd40f23f6b17",
510
+ "label": "Excerpt Color",
511
+ "name": "acfb_post_excerpt_color",
512
+ "type": "color_picker",
513
+ "instructions": "",
514
+ "required": 0,
515
+ "conditional_logic": [
516
+ [
517
+ {
518
+ "field": "field_5cd68d5164051",
519
+ "operator": "==",
520
+ "value": "1"
521
+ }
522
+ ]
523
+ ],
524
+ "wrapper": {
525
+ "width": "",
526
+ "class": "",
527
+ "id": ""
528
+ },
529
+ "default_value": "#191e23"
530
+ },
531
+ {
532
+ "key": "field_5cd40ef8f6b16",
533
+ "label": "Excerpt Size",
534
+ "name": "acfb_post_excerpt_size",
535
+ "type": "range",
536
+ "instructions": "",
537
+ "required": 0,
538
+ "conditional_logic": [
539
+ [
540
+ {
541
+ "field": "field_5cd68d5164051",
542
+ "operator": "==",
543
+ "value": "1"
544
+ }
545
+ ]
546
+ ],
547
+ "wrapper": {
548
+ "width": "",
549
+ "class": "",
550
+ "id": ""
551
+ },
552
+ "default_value": 17,
553
+ "min": "",
554
+ "max": "",
555
+ "step": "",
556
+ "prepend": "",
557
+ "append": "px"
558
+ },
559
+ {
560
+ "key": "field_5cd68da164052",
561
+ "label": "Button Custom Styles",
562
+ "name": "acfb_post_button_custom_styles",
563
+ "type": "true_false",
564
+ "instructions": "",
565
+ "required": 0,
566
+ "conditional_logic": 0,
567
+ "wrapper": {
568
+ "width": "",
569
+ "class": "",
570
+ "id": ""
571
+ },
572
+ "message": "",
573
+ "default_value": 0,
574
+ "ui": 1,
575
+ "ui_on_text": "",
576
+ "ui_off_text": ""
577
+ },
578
+ {
579
+ "key": "field_5cd40f78f6b18",
580
+ "label": "Button Background Color",
581
+ "name": "acfb_post_button_background_color",
582
+ "type": "color_picker",
583
+ "instructions": "",
584
+ "required": 0,
585
+ "conditional_logic": [
586
+ [
587
+ {
588
+ "field": "field_5cd68da164052",
589
+ "operator": "==",
590
+ "value": "1"
591
+ }
592
+ ]
593
+ ],
594
+ "wrapper": {
595
+ "width": "",
596
+ "class": "",
597
+ "id": ""
598
+ },
599
+ "default_value": "#191e23"
600
+ },
601
+ {
602
+ "key": "field_5cd40fa0f6b19",
603
+ "label": "Button Text Color",
604
+ "name": "acfb_post_button_text_color",
605
+ "type": "color_picker",
606
+ "instructions": "",
607
+ "required": 0,
608
+ "conditional_logic": [
609
+ [
610
+ {
611
+ "field": "field_5cd68da164052",
612
+ "operator": "==",
613
+ "value": "1"
614
+ }
615
+ ]
616
+ ],
617
+ "wrapper": {
618
+ "width": "",
619
+ "class": "",
620
+ "id": ""
621
+ },
622
+ "default_value": "#ffffff"
623
+ },
624
+ {
625
+ "key": "field_5cd40fb8f6b1a",
626
+ "label": "Button Background Hover Color",
627
+ "name": "acfb_post_button_background_hover_color",
628
+ "type": "color_picker",
629
+ "instructions": "",
630
+ "required": 0,
631
+ "conditional_logic": [
632
+ [
633
+ {
634
+ "field": "field_5cd68da164052",
635
+ "operator": "==",
636
+ "value": "1"
637
+ }
638
+ ]
639
+ ],
640
+ "wrapper": {
641
+ "width": "",
642
+ "class": "",
643
+ "id": ""
644
+ },
645
+ "default_value": "#191e23"
646
+ },
647
+ {
648
+ "key": "field_5cd40fecf6b1b",
649
+ "label": "Button Text Hover Color",
650
+ "name": "acfb_post_button_text_hover_color",
651
+ "type": "color_picker",
652
+ "instructions": "",
653
+ "required": 0,
654
+ "conditional_logic": [
655
+ [
656
+ {
657
+ "field": "field_5cd68da164052",
658
+ "operator": "==",
659
+ "value": "1"
660
+ }
661
+ ]
662
+ ],
663
+ "wrapper": {
664
+ "width": "",
665
+ "class": "",
666
+ "id": ""
667
+ },
668
+ "default_value": "#ffffff"
669
+ },
670
+ {
671
+ "key": "field_5cd41014f6b1c",
672
+ "label": "Button Size",
673
+ "name": "acfb_post_button_size",
674
+ "type": "range",
675
+ "instructions": "",
676
+ "required": 0,
677
+ "conditional_logic": [
678
+ [
679
+ {
680
+ "field": "field_5cd68da164052",
681
+ "operator": "==",
682
+ "value": "1"
683
+ }
684
+ ]
685
+ ],
686
+ "wrapper": {
687
+ "width": "",
688
+ "class": "",
689
+ "id": ""
690
+ },
691
+ "default_value": 16,
692
+ "min": "",
693
+ "max": "",
694
+ "step": "",
695
+ "prepend": "",
696
+ "append": "px"
697
+ }
698
+ ],
699
+ "location": [
700
+ [
701
+ {
702
+ "param": "block",
703
+ "operator": "==",
704
+ "value": "acf\/acfb-posts"
705
+ }
706
+ ]
707
+ ],
708
+ "menu_order": 0,
709
+ "position": "normal",
710
+ "style": "default",
711
+ "label_placement": "top",
712
+ "instruction_placement": "label",
713
+ "hide_on_screen": "",
714
+ "active": 1,
715
+ "description": "",
716
+ "modified": 1557736059
717
+ }
block-templates/click-to-tweet.php CHANGED
@@ -1,5 +1,16 @@
1
- <?php $uid = $block['id'];?>
2
- <div class="<?php echo $uid; ?>">
 
 
 
 
 
 
 
 
 
 
 
3
  <style type="text/css">
4
  .<?php echo $uid; ?> .acfb_click_to_tweet {
5
  background-color: <?php the_field('acfb_click_to_tweet_bg_color'); ?>;
1
+ <?php
2
+ $uid = $block['id'];
3
+
4
+ $className = 'acfb_click_to_tweet_block';
5
+ if( !empty($block['className']) ) {
6
+ $className .= ' ' . $block['className'];
7
+ }
8
+ if( !empty($block['align']) ) {
9
+ $className .= ' align' . $block['align'];
10
+ }
11
+
12
+ ?>
13
+ <div class="<?php echo $uid; ?> <?php echo esc_attr($className); ?>">
14
  <style type="text/css">
15
  .<?php echo $uid; ?> .acfb_click_to_tweet {
16
  background-color: <?php the_field('acfb_click_to_tweet_bg_color'); ?>;
block-templates/counter-number.php CHANGED
@@ -1,5 +1,16 @@
1
- <?php $uid = $block['id'];?>
2
- <div class="<?php echo $uid; ?>">
 
 
 
 
 
 
 
 
 
 
 
3
  <style type="text/css">
4
  .<?php echo $uid; ?> .acfb_counter_number_wrapper{
5
  color: <?php the_field('acfb_counter_number_color'); ?>;
1
+ <?php
2
+ $uid = $block['id'];
3
+
4
+ $className = 'acfb_counter_number_block';
5
+ if( !empty($block['className']) ) {
6
+ $className .= ' ' . $block['className'];
7
+ }
8
+ if( !empty($block['align']) ) {
9
+ $className .= ' align' . $block['align'];
10
+ }
11
+
12
+ ?>
13
+ <div class="<?php echo $uid; ?> <?php echo esc_attr($className); ?>">
14
  <style type="text/css">
15
  .<?php echo $uid; ?> .acfb_counter_number_wrapper{
16
  color: <?php the_field('acfb_counter_number_color'); ?>;
block-templates/loop-templates/post-grid.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if( have_rows('acfb_post_grid_elements') ):
4
+
5
+ while ( have_rows('acfb_post_grid_elements') ) : the_row(); ?>
6
+
7
+ <?php if( get_row_layout() == 'post_grid_image' ): ?>
8
+ <div class="acfb_post_thumbnail">
9
+ <?php the_post_thumbnail(); ?>
10
+ </div>
11
+ <?php endif; ?>
12
+
13
+ <?php if( get_row_layout() == 'post_grid_title' ): ?>
14
+ <div class="acfb_post_title">
15
+ <<?php echo $acfb_post_title_html_tag; ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></<?php echo $acfb_post_title_html_tag; ?>>
16
+ </div>
17
+ <?php endif; ?>
18
+
19
+ <?php if( get_row_layout() == 'post_grid_meta_data' ): ?>
20
+ <div class="acfb_post_meta">
21
+ <span class="acfb_post_author"><?php the_author(); ?></span> -
22
+ <span class="acfb_post_date"><?php the_time('F jS, Y') ?></span>
23
+ </div>
24
+ <?php endif; ?>
25
+
26
+ <?php if( get_row_layout() == 'post_grid_content' ): ?>
27
+ <div class="acfb_post_excerpt">
28
+ <?php echo acfb_excerpt($acfb_post_excerpt_length); ?>
29
+ </div>
30
+ <?php endif; ?>
31
+
32
+ <?php if( get_row_layout() == 'post_grid_read_more_button' ): ?>
33
+ <div class="acfb_post_button">
34
+ <a href="<?php the_permalink(); ?>" class="acfb_post_btn">Read More</a>
35
+ </div>
36
+ <?php endif; ?>
37
+
38
+
39
+ <?php
40
+ endwhile;
41
+ endif;
42
+ ?>
block-templates/loop-templates/post-list.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="acfb_post_list_thumbnail">
2
+ <?php the_post_thumbnail(); ?>
3
+ </div>
4
+ <div class="acfb_post_list_content">
5
+ <?php
6
+ if( have_rows('acfb_post_list_elements') ):
7
+
8
+ while ( have_rows('acfb_post_list_elements') ) : the_row(); ?>
9
+
10
+ <?php if( get_row_layout() == 'post_list_title' ): ?>
11
+ <div class="acfb_post_title">
12
+ <<?php echo $acfb_post_title_html_tag; ?>><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></<?php echo $acfb_post_title_html_tag; ?>>
13
+ </div>
14
+ <?php endif; ?>
15
+
16
+ <?php if( get_row_layout() == 'post_list_meta_data' ): ?>
17
+ <div class="acfb_post_meta">
18
+ <span class="acfb_post_author"><?php the_author(); ?></span> -
19
+ <span class="acfb_post_date"><?php the_time('F jS, Y') ?></span>
20
+ </div>
21
+ <?php endif; ?>
22
+
23
+ <?php if( get_row_layout() == 'post_list_content' ): ?>
24
+ <div class="acfb_post_excerpt">
25
+ <?php echo acfb_excerpt($acfb_post_excerpt_length); ?>
26
+ </div>
27
+ <?php endif; ?>
28
+
29
+ <?php if( get_row_layout() == 'post_list_read_more_button' ): ?>
30
+ <div class="acfb_post_button">
31
+ <a href="<?php the_permalink(); ?>" class="acfb_post_btn">Read More</a>
32
+ </div>
33
+ <?php endif; ?>
34
+
35
+
36
+ <?php
37
+ endwhile;
38
+ endif;
39
+ ?>
40
+ </div>
block-templates/multi-buttons.php CHANGED
@@ -1,5 +1,16 @@
1
- <?php $uid = $block['id'];?>
2
- <div class="<?php echo $uid; ?>">
 
 
 
 
 
 
 
 
 
 
 
3
  <style type="text/css">
4
  .<?php echo $uid; ?> .acfb_multibuttons_wrap .acfb_button{
5
  font-size: <?php the_field('acfb_multibutton_text_size'); ?>px;
1
+ <?php
2
+ $uid = $block['id'];
3
+
4
+ $className = 'acfb_multibuttons_block';
5
+ if( !empty($block['className']) ) {
6
+ $className .= ' ' . $block['className'];
7
+ }
8
+ if( !empty($block['align']) ) {
9
+ $className .= ' align' . $block['align'];
10
+ }
11
+
12
+ ?>
13
+ <div class="<?php echo $uid; ?> <?php echo esc_attr($className); ?>">
14
  <style type="text/css">
15
  .<?php echo $uid; ?> .acfb_multibuttons_wrap .acfb_button{
16
  font-size: <?php the_field('acfb_multibutton_text_size'); ?>px;
block-templates/posts.php ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $uid = $block['id'];
3
+
4
+ $className = 'acfb_posts_block';
5
+ if( !empty($block['className']) ) {
6
+ $className .= ' ' . $block['className'];
7
+ }
8
+ if( !empty($block['align']) ) {
9
+ $className .= ' align' . $block['align'];
10
+ }
11
+
12
+ ?>
13
+
14
+ <div class="<?php echo $uid; ?> <?php echo esc_attr($className); ?>">
15
+
16
+ <?php
17
+ $acfb_posts_layout = get_field('acfb_posts_layout');
18
+ $acfb_number_of_posts = get_field('acfb_number_of_posts');
19
+ $acfb_posts_columns = get_field('acfb_posts_columns');
20
+ $acfb_post_excerpt_length = get_field('acfb_post_excerpt_length');
21
+ $acfb_post_title_html_tag = get_field('acfb_post_title_html_tag');
22
+ ?>
23
+ <style type="text/css">
24
+ .<?php echo $uid; ?> .acfb_post {
25
+ background: <?php the_field('acfb_post_background_color'); ?>;
26
+ }
27
+
28
+ <?php if( get_field('acfb_post_title_custom_styles') == '1' ): ?>
29
+ .<?php echo $uid; ?> .acfb_post .acfb_post_title a{
30
+ color: <?php the_field('acfb_post_title_color'); ?> !important;
31
+ font-size: <?php the_field('acfb_post_title_size'); ?>px;
32
+ text-decoration: none;
33
+ }
34
+
35
+ .<?php echo $uid; ?> .acfb_post .acfb_post_title a:hover{
36
+ color: <?php the_field('acfb_post_title_hover_color'); ?> !important;
37
+ }
38
+ <?php endif; ?>
39
+
40
+ <?php if( get_field('acfb_post_meta_custom_styles') == '1' ): ?>
41
+ .<?php echo $uid; ?> .acfb_post .acfb_post_meta{
42
+ color: <?php the_field('acfb_post_meta_color'); ?>;
43
+ font-size: <?php the_field('acfb_post_meta_size'); ?>px;
44
+ }
45
+ <?php endif; ?>
46
+
47
+ <?php if( get_field('acfb_post_excerpt_custom_styles') == '1' ): ?>
48
+ .<?php echo $uid; ?> .acfb_post .acfb_post_excerpt{
49
+ color: <?php the_field('acfb_post_excerpt_color'); ?>;
50
+ font-size: <?php the_field('acfb_post_excerpt_size'); ?>px;
51
+ }
52
+ <?php endif; ?>
53
+
54
+ <?php if( get_field('acfb_post_button_custom_styles') == '1' ): ?>
55
+ .<?php echo $uid; ?> .acfb_post .acfb_post_button a{
56
+ background-color: <?php the_field('acfb_post_button_background_color'); ?>;
57
+ color: <?php the_field('acfb_post_button_text_color'); ?> !important;
58
+ font-size: <?php the_field('acfb_post_button_size'); ?>px;
59
+ padding: 10px;
60
+ }
61
+
62
+ .<?php echo $uid; ?> .acfb_post .acfb_post_button a:hover{
63
+ background-color: <?php the_field('acfb_post_button_background_hover_color'); ?>;
64
+ color: <?php the_field('acfb_post_button_text_hover_color'); ?> !important;
65
+ }
66
+ <?php endif; ?>
67
+ </style>
68
+
69
+
70
+ <?php
71
+
72
+ $acfb_grid_col = '';
73
+ if($acfb_posts_layout == 'grid'){
74
+ $acfb_grid_col = "acfb_post_" . $acfb_posts_columns;
75
+ }
76
+
77
+ $acfb_cat = get_field( 'acfb_category_filters' );
78
+
79
+ $acfb_cat_names = array();
80
+ if(is_array($acfb_cat)){
81
+ foreach($acfb_cat as $catskey => $catsval){
82
+ $acfb_cat_names[] = $catsval;
83
+ }
84
+ }
85
+
86
+ $args = array(
87
+ 'post_type' => 'post',
88
+ 'post_status' => 'publish',
89
+ 'posts_per_page' => $acfb_number_of_posts,
90
+ 'cat' => $acfb_cat_names,
91
+ );
92
+
93
+
94
+ // the query
95
+ $the_query = new WP_Query( $args ); ?>
96
+
97
+ <?php if ( $the_query->have_posts() ) : ?>
98
+
99
+ <div class="acfb_post_<?php echo $acfb_posts_layout; ?> <?php echo $acfb_grid_col; ?>">
100
+
101
+ <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
102
+
103
+ <?php
104
+ $acfb_thumb = '';
105
+ if ( has_post_thumbnail() ){
106
+ $acfb_thumb = 'thumb';
107
+ } else{
108
+ $acfb_thumb = 'no_thumb';
109
+ }
110
+ ?>
111
+
112
+ <div class="acfb_post <?php echo $acfb_thumb; ?>">
113
+
114
+ <?php
115
+ if($acfb_posts_layout == 'list'){
116
+
117
+ include( 'loop-templates/post-list.php' );
118
+
119
+ } elseif ($acfb_posts_layout == 'grid') {
120
+
121
+ include( 'loop-templates/post-grid.php' );
122
+
123
+ }
124
+ ?>
125
+
126
+ </div>
127
+ <?php endwhile; ?>
128
+
129
+ </div>
130
+
131
+ <?php wp_reset_postdata(); ?>
132
+
133
+ <?php else : ?>
134
+ <p><?php esc_html_e( 'Sorry, no posts matched your criteria.' ); ?></p>
135
+ <?php endif; ?>
136
+
137
+
138
+
139
+ </div><!-- Uid -->
block-templates/price-list.php CHANGED
@@ -1,5 +1,16 @@
1
- <?php $uid = $block['id'];?>
2
- <div class="<?php echo $uid; ?>">
 
 
 
 
 
 
 
 
 
 
 
3
  <style type="text/css">
4
 
5
  .<?php echo $uid; ?> .acfb_price_list_wrap .acfb_price_list_item .acfb_price_list_text .acfb_price_list_header{
1
+ <?php
2
+ $uid = $block['id'];
3
+
4
+ $className = 'acfb_price_list_block';
5
+ if( !empty($block['className']) ) {
6
+ $className .= ' ' . $block['className'];
7
+ }
8