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