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