PluginProbe ʕ •ᴥ•ʔ
The Post Grid – Shortcode, Gutenberg Blocks and Elementor Addon for Post Grid / 7.0.2
The Post Grid – Shortcode, Gutenberg Blocks and Elementor Addon for Post Grid v7.0.2
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 3 years ago SettingsTabController.php 3 years ago StyleTabController.php 3 years ago
ContentTabController.php
386 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 'main_wrapper_hover_tab' => [
80 'type' => 'string',
81 'default' => 'normal',
82 ],
83
84 'grid_offset_col_width' => [
85 'type' => 'string',
86 'default' => '',
87 ],
88
89 'full_wrapper_align' => [
90 'type' => 'object',
91 'default' => [],
92 'style' => [
93 (object) [
94 'selector' => '{{RTTPG}} .tpg-post-holder div {text-align: {{full_wrapper_align}}; }'
95 ]
96 ]
97 ],
98
99 //Query Build
100
101 'post_type' => [
102 'type' => 'string',
103 'default' => 'post',
104 ],
105
106 'post_id' => [
107 'type' => 'string',
108 'default' => '',
109 ],
110
111 'exclude' => [
112 'type' => 'string',
113 'default' => '',
114 ],
115
116 'post_limit' => [
117 'type' => 'string',
118 'default' => '',
119 ],
120
121 'offset' => [
122 'type' => 'string',
123 'default' => '',
124 ],
125
126 //Todo: Query Advance Filter give below
127
128 'taxonomy_lists' => [
129 'type' => 'object',
130 'default' => [],
131 ],
132
133 'author' => [
134 'type' => 'string',
135 'default' => '',
136 ],
137
138 'post_keyword' => [
139 'type' => 'string',
140 'default' => '',
141 ],
142
143 'relation' => [
144 'type' => 'string',
145 'default' => 'OR',
146 ],
147
148 'start_date' => [
149 'type' => 'string',
150 'default' => '',
151 ],
152 'end_date' => [
153 'type' => 'string',
154 'default' => '',
155 ],
156
157 'orderby' => [
158 'type' => 'string',
159 'default' => 'date',
160 ],
161
162 'order' => [
163 'type' => 'string',
164 'default' => 'desc',
165 ],
166
167 'ignore_sticky_posts' => [
168 'type' => 'string',
169 'default' => '',
170 ],
171
172 'no_posts_found_text' => [
173 'type' => 'string',
174 'default' => 'No posts found.',
175 ],
176
177
178 //Front-end Filter Settings
179
180 'show_taxonomy_filter' => [
181 'type' => 'string',
182 'default' => '',
183 ],
184
185 'show_author_filter' => [
186 'type' => 'string',
187 'default' => '',
188 ],
189
190 'show_order_by' => [
191 'type' => 'string',
192 'default' => '',
193 ],
194
195 'show_sort_order' => [
196 'type' => 'string',
197 'default' => '',
198 ],
199
200 'show_search' => [
201 'type' => 'string',
202 'default' => '',
203 ],
204
205 'filter_type' => [
206 'type' => 'string',
207 'default' => 'dropdown',
208 ],
209
210 'filter_taxonomy' => [
211 'type' => 'string',
212 'default' => 'category',
213 ],
214
215 'filter_btn_style' => [
216 'type' => 'string',
217 'default' => 'default',
218 ],
219
220 'filter_btn_item_per_page' => [
221 'type' => 'string',
222 'default' => 'auto',
223 ],
224
225 //TODO: All Frontend filter are given below:
226
227 'filter_post_count' => [
228 'type' => 'string',
229 'default' => 'no',
230 ],
231
232 'tgp_filter_taxonomy_hierarchical' => [
233 'type' => 'string',
234 'default' => 'yes',
235 ],
236
237 'tpg_hide_all_button' => [
238 'type' => 'string',
239 'default' => 'yes',
240 ],
241
242 'tax_filter_all_text' => [
243 'type' => 'string',
244 'default' => '',
245 ],
246
247 'author_filter_all_text' => [
248 'type' => 'string',
249 'default' => '',
250 ],
251
252 //Pagination
253
254 'show_pagination' => [
255 'type' => 'string',
256 'default' => '',
257 ],
258
259 'page' => [
260 'type' => 'number',
261 'default' => 1,
262 ],
263
264 'display_per_page' => [
265 'type' => 'string',
266 'default' => '6',
267 ],
268
269 'pagination_type' => [
270 'type' => 'string',
271 'default' => 'pagination',
272 ],
273
274 'ajax_pagination_type' => [
275 'type' => 'string',
276 'default' => '',
277 ],
278
279 'load_more_button_text' => [
280 'type' => 'string',
281 'default' => 'Load More',
282 ],
283
284 //Links
285
286 'post_link_type' => [
287 'type' => 'string',
288 'default' => 'default',
289 ],
290
291 'link_target' => [
292 'type' => 'string',
293 'default' => '_self',
294 ],
295
296 'is_thumb_linked' => [
297 'type' => 'string',
298 'default' => 'yes',
299 ],
300
301 'pagination_btn_position' => [
302 'type' => 'string',
303 'default' => '',
304 'style' => [
305 (object) [
306 'selector' => '{{RTTPG}} .rt-pagination-wrap {position: {{pagination_btn_position}};margin:0;}'
307 ]
308 ]
309 ],
310
311 'pagination_pos_val' => [
312 'type' => 'object',
313 "default" => (object) [
314 'lg' => '',
315 'md' => '',
316 'sm' => '',
317 ],
318 'style' => [
319 (object) [
320 'selector' => '{{RTTPG}} .rt-pagination-wrap{top:{{pagination_pos_val}};}'
321 ]
322 ]
323 ],
324
325 'pagination_pos_val_left' => [
326 'type' => 'object',
327 "default" => (object) [
328 'lg' => '',
329 'md' => '',
330 'sm' => '',
331 ],
332 'style' => [
333 (object) [
334 'selector' => '{{RTTPG}} .rt-pagination-wrap{left:{{pagination_pos_val_left}};}'
335 ]
336 ]
337 ],
338
339 'pagination_btn_space_btween' => [
340 'type' => 'string',
341 'default' => '',
342 ],
343 ];
344
345 $post_types = Fns::get_post_types();
346
347 //Field Selections
348
349 $cf = Fns::is_acf();
350 if ( $cf && rtTPG()->hasPro() ) {
351 $content_attribute['show_acf'] = [
352 'type' => 'string',
353 'default' => '',
354 ];
355
356 foreach ( $post_types as $post_type => $post_type_title ) {
357 $get_acf_field = Fns::get_groups_by_post_type( $post_type );
358 $selected_acf_id = '';
359 if ( ! empty( $get_acf_field ) && is_array( $get_acf_field ) ) {
360 $selected_acf_id = array_key_first( $get_acf_field );
361 }
362
363 $content_attribute[ $post_type . '_cf_group' ] = [
364 'type' => 'string',
365 'default' => '',
366 ];
367 }
368
369 $content_attribute['cf_hide_empty_value'] = [
370 'type' => 'string',
371 'default' => 'yes',
372 ];
373 $content_attribute['cf_hide_group_title'] = [
374 'type' => 'string',
375 'default' => 'yes',
376 ];
377 $content_attribute['cf_show_only_value'] = [
378 'type' => 'string',
379 'default' => 'yes',
380 ];
381
382 }
383
384 return apply_filters( 'rttpg_guten_content_attribute', $content_attribute );
385 }
386 }