PluginProbe ʕ •ᴥ•ʔ
The Post Grid – Shortcode, Gutenberg Blocks and Elementor Addon for Post Grid / 7.8.8
The Post Grid – Shortcode, Gutenberg Blocks and Elementor Addon for Post Grid v7.8.8
7.9.3 7.9.2 trunk 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.1.5 4.2.0 4.2.1 4.2.2 4.2.3 5.0.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 6.0.0 7.0.0 7.0.1 7.0.2 7.1.0 7.2.0 7.2.1 7.2.10 7.2.11 7.2.2 7.2.3 7.2.4 7.2.5 7.2.6 7.2.7 7.2.8 7.2.9 7.3.0 7.3.1 7.4.0 7.4.1 7.4.2 7.4.3 7.5.0 7.6.0 7.6.1 7.7.0 7.7.1 7.7.10 7.7.11 7.7.12 7.7.13 7.7.14 7.7.15 7.7.16 7.7.17 7.7.18 7.7.19 7.7.2 7.7.20 7.7.21 7.7.22 7.7.3 7.7.4 7.7.5 7.7.6 7.7.7 7.7.8 7.7.9 7.8.0 7.8.1 7.8.2 7.8.3 7.8.4 7.8.5 7.8.6 7.8.7 7.8.8 7.8.9 7.9.0 7.9.1
the-post-grid / app / Controllers / Blocks / BlockController / TimelineContentTabController.php
the-post-grid / app / Controllers / Blocks / BlockController Last commit date
ContentTabController.php 8 months ago SectionTitleSettingsStyle.php 8 months ago SettingsTabController.php 8 months ago StyleTabController.php 8 months ago TimelineContentTabController.php 8 months ago
TimelineContentTabController.php
445 lines
1 <?php
2
3 namespace RT\ThePostGrid\Controllers\Blocks\BlockController;
4
5 use RT\ThePostGrid\Helpers\Fns;
6
7 //phpcs:disable WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
8
9 /**
10 * Class TimelineContentTabController
11 */
12 class TimelineContentTabController {
13 /**
14 * @param $attribute_args
15 *
16 * @return mixed|void
17 */
18 public static function get_controller( $attribute_args ) {
19 $prefix = $attribute_args['prefix'];
20 $default_layout = $attribute_args['default_layout'];
21
22 $content_attribute = [
23 'uniqueId' => [
24 'type' => 'string',
25 'default' => '',
26 ],
27
28 'preview' => [
29 'type' => 'boolean',
30 'default' => false,
31 ],
32
33 'prefix' => [
34 'type' => 'string',
35 'default' => $prefix,
36 ],
37
38 'offset_img_position' => [
39 'type' => 'string',
40 'default' => 'offset-image-left',
41 ],
42
43 'is_builder' => [
44 'type' => 'string',
45 'default' => '',
46 ],
47
48 // Layouts.
49
50 'query_change' => [
51 'type' => 'boolean',
52 'default' => false,
53 ],
54
55 $prefix . '_layout' => [
56 'type' => 'string',
57 'default' => $default_layout,
58 ],
59
60 'middle_border' => [
61 'type' => 'string',
62 'default' => 'no',
63 ],
64
65 'grid_column' => [
66 'type' => 'object',
67 'default' => (object) [
68 'lg' => '',
69 'md' => '',
70 'sm' => '',
71 ],
72 ],
73
74 'grid_layout_style' => [
75 'type' => 'string',
76 'default' => 'tpg-even',
77 ],
78
79 'list_layout_alignment' => [
80 'type' => 'string',
81 'default' => '',
82 'style' => [
83 (object) [
84 'selector' => '{{RTTPG}} .tpg-el-main-wrapper .list-behaviour .rt-holder .rt-el-content-wrapper {align-items: {{list_layout_alignment}}; }',
85 ],
86 ],
87 ],
88
89 'list_flex_direction' => [
90 'type' => 'string',
91 'default' => '',
92 'style' => [
93 (object) [
94 'selector' => '{{RTTPG}} .tpg-el-main-wrapper .list-behaviour .rt-holder .rt-el-content-wrapper {flex-direction: {{list_flex_direction}}; }',
95 ],
96 ],
97 ],
98
99 'main_wrapper_hover_tab' => [
100 'type' => 'string',
101 'default' => 'normal',
102 ],
103
104 'grid_offset_col_width' => [
105 'type' => 'string',
106 'default' => '',
107 ],
108
109 'full_wrapper_align' => [
110 'type' => 'object',
111 'default' => [],
112 'style' => [
113 (object) [
114 'selector' => '{{RTTPG}} .tpg-post-holder div {text-align: {{full_wrapper_align}}; }
115 {{RTTPG}} .rt-tpg-container .rt-el-post-meta {justify-content: {{full_wrapper_align}}; }',
116 ],
117 ],
118 ],
119
120 // Query Build.
121
122 'show_title' => [
123 'type' => 'string',
124 'default' => '',
125 ],
126
127 'multiple_post_type' => [
128 'type' => 'string',
129 'default' => '',
130 ],
131
132 'post_type' => [
133 'type' => 'string',
134 'default' => 'post',
135 ],
136
137 'post_types' => [
138 'type' => 'array',
139 'default' => [],
140 ],
141
142 'post_id' => [
143 'type' => 'string',
144 'default' => '',
145 ],
146
147 'exclude' => [
148 'type' => 'string',
149 'default' => '',
150 ],
151
152 'post_limit' => [
153 'type' => 'string',
154 'default' => '',
155 ],
156
157 'offset' => [
158 'type' => 'string',
159 'default' => '',
160 ],
161
162 'instant_query' => [
163 'type' => 'string',
164 'default' => '',
165 ],
166
167 // Query Advance Filter give below.
168
169 'taxonomy_lists' => [
170 'type' => 'object',
171 'default' => [],
172 ],
173
174 'author' => [
175 'type' => 'string',
176 'default' => '',
177 ],
178
179 'post_keyword' => [
180 'type' => 'string',
181 'default' => '',
182 ],
183
184 'relation' => [
185 'type' => 'string',
186 'default' => 'OR',
187 ],
188
189 'start_date' => [
190 'type' => 'string',
191 'default' => '',
192 ],
193 'end_date' => [
194 'type' => 'string',
195 'default' => '',
196 ],
197
198 'orderby' => [
199 'type' => 'string',
200 'default' => 'date',
201 ],
202
203 'order' => [
204 'type' => 'string',
205 'default' => 'desc',
206 ],
207
208 'ignore_sticky_posts' => [
209 'type' => 'string',
210 'default' => '',
211 ],
212
213 'no_posts_found_text' => [
214 'type' => 'string',
215 'default' => 'No posts found.',
216 ],
217
218 // Front-end Filter Settings.
219
220 'multiple_taxonomy' => [
221 'type' => 'string',
222 'default' => '',
223 ],
224
225 'show_taxonomy_filter' => [
226 'type' => 'string',
227 'default' => '',
228 ],
229
230 'show_author_filter' => [
231 'type' => 'string',
232 'default' => '',
233 ],
234
235 'show_order_by' => [
236 'type' => 'string',
237 'default' => '',
238 ],
239
240 'show_sort_order' => [
241 'type' => 'string',
242 'default' => '',
243 ],
244
245 'show_search' => [
246 'type' => 'string',
247 'default' => '',
248 ],
249
250 'search_by' => [
251 'type' => 'string',
252 'default' => 'all_content',
253 ],
254
255 'filter_type' => [
256 'type' => 'string',
257 'default' => 'dropdown',
258 ],
259
260 'filter_taxonomy' => [
261 'type' => 'string',
262 'default' => 'category',
263 ],
264
265 'filter_taxonomies' => [
266 'type' => 'array',
267 'default' => [],
268 ],
269
270 'filter_btn_style' => [
271 'type' => 'string',
272 'default' => 'default',
273 ],
274
275 'filter_btn_item_per_page' => [
276 'type' => 'string',
277 'default' => 'auto',
278 ],
279
280 'filter_post_count' => [
281 'type' => 'string',
282 'default' => 'no',
283 ],
284
285 'tgp_filter_taxonomy_hierarchical' => [
286 'type' => 'string',
287 'default' => 'yes',
288 ],
289
290 'tpg_hide_all_button' => [
291 'type' => 'string',
292 'default' => 'yes',
293 ],
294
295 'tax_filter_all_text' => [
296 'type' => 'string',
297 'default' => '',
298 ],
299
300 'custom_taxonomy_order' => [
301 'type' => 'string',
302 'default' => 'yes',
303 ],
304
305 'author_filter_all_text' => [
306 'type' => 'string',
307 'default' => '',
308 ],
309
310 // Pagination.
311
312 'show_pagination' => [
313 'type' => 'string',
314 'default' => '',
315 ],
316
317 'page' => [
318 'type' => 'number',
319 'default' => 1,
320 ],
321
322 'display_per_page' => [
323 'type' => 'string',
324 'default' => '',
325 ],
326
327 'pagination_type' => [
328 'type' => 'string',
329 'default' => 'pagination',
330 ],
331
332 'ajax_pagination_type' => [
333 'type' => 'string',
334 'default' => '',
335 ],
336
337 'load_more_button_text' => [
338 'type' => 'string',
339 'default' => 'Load More',
340 ],
341
342 // Links.
343
344 'post_link_type' => [
345 'type' => 'string',
346 'default' => 'default',
347 ],
348
349 'link_target' => [
350 'type' => 'string',
351 'default' => '_self',
352 ],
353
354 'is_thumb_linked' => [
355 'type' => 'string',
356 'default' => 'yes',
357 ],
358
359 'pagination_btn_position' => [
360 'type' => 'string',
361 'default' => '',
362 'style' => [
363 (object) [
364 'selector' => '{{RTTPG}} .rt-pagination-wrap {position: {{pagination_btn_position}};margin:0;}',
365 ],
366 ],
367 ],
368
369 'pagination_pos_val' => [
370 'type' => 'object',
371 'default' => (object) [
372 'lg' => '',
373 'md' => '',
374 'sm' => '',
375 ],
376 'style' => [
377 (object) [
378 'selector' => '{{RTTPG}} .rt-pagination-wrap{top:{{pagination_pos_val}};}',
379 ],
380 ],
381 ],
382
383 'pagination_pos_val_left' => [
384 'type' => 'object',
385 'default' => (object) [
386 'lg' => '',
387 'md' => '',
388 'sm' => '',
389 ],
390 'style' => [
391 (object) [
392 'selector' => '{{RTTPG}} .rt-pagination-wrap{left:{{pagination_pos_val_left}};}',
393 ],
394 ],
395 ],
396
397 'pagination_btn_space_btween' => [
398 'type' => 'string',
399 'default' => '',
400 ],
401 ];
402
403 $post_types = Fns::get_post_types();
404
405 // Field Selections.
406
407 $cf = Fns::is_acf();
408 if ( $cf && rtTPG()->hasPro() ) {
409 $content_attribute['show_acf'] = [
410 'type' => 'string',
411 'default' => '',
412 ];
413
414 foreach ( $post_types as $post_type => $post_type_title ) {
415 $get_acf_field = Fns::get_groups_by_post_type( $post_type );
416 $selected_acf_id = '';
417 if ( ! empty( $get_acf_field ) && is_array( $get_acf_field ) ) {
418 $selected_acf_id = array_key_first( $get_acf_field );
419 }
420
421 $content_attribute[ $post_type . '_cf_group' ] = [
422 'type' => 'string',
423 'default' => '',
424 ];
425 }
426
427 $content_attribute['cf_hide_empty_value'] = [
428 'type' => 'string',
429 'default' => 'yes',
430 ];
431 $content_attribute['cf_hide_group_title'] = [
432 'type' => 'string',
433 'default' => 'yes',
434 ];
435 $content_attribute['cf_show_only_value'] = [
436 'type' => 'string',
437 'default' => 'yes',
438 ];
439
440 }
441
442 return apply_filters( 'rttpg_guten_content_attribute', $content_attribute );
443 }
444 }
445