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 / Helpers / Options.php
the-post-grid / app / Helpers Last commit date
Fns.php 2 years ago Install.php 2 years ago Options.php 2 years ago
Options.php
1862 lines
1 <?php
2 /**
3 * Options Helper class.
4 *
5 * @package RT_TPG
6 */
7
8 namespace RT\ThePostGrid\Helpers;
9
10 // Do not allow directly accessing this file.
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit( 'This script cannot be accessed directly.' );
13 }
14
15 /**
16 * Options Helper class.
17 */
18 class Options {
19
20 public static function rtPostTypes() {
21 $args = apply_filters(
22 'tpg_get_post_type',
23 [
24 'public' => true,
25 ]
26 );
27
28 $post_types = get_post_types( $args );
29
30 $exclude = [ 'attachment', 'revision', 'nav_menu_item', 'elementor_library', 'tpg_builder' ];
31
32 foreach ( $exclude as $ex ) {
33 unset( $post_types[ $ex ] );
34 }
35
36 if ( ! rtTPG()->hasPro() ) {
37 $post_types = [
38 'post' => $post_types['post'],
39 'page' => $post_types['page'],
40 ];
41 }
42
43 return $post_types;
44 }
45
46 public static function rtPostOrders() {
47 return [
48 'ASC' => esc_html__( 'Ascending', 'the-post-grid' ),
49 'DESC' => esc_html__( 'Descending', 'the-post-grid' ),
50 ];
51 }
52
53 public static function rtTermOperators() {
54 return [
55 'IN' => esc_html__(
56 'IN — show posts which associate with one or more of selected terms',
57 'the-post-grid'
58 ),
59 'NOT IN' => esc_html__(
60 'NOT IN — show posts which do not associate with any of selected terms',
61 'the-post-grid'
62 ),
63 'AND' => esc_html__( 'AND — show posts which associate with all of selected terms', 'the-post-grid' ),
64 ];
65 }
66
67 public static function rtTermRelations() {
68 return [
69 'AND' => esc_html__( 'AND — show posts which match all settings', 'the-post-grid' ),
70 'OR' => esc_html__( 'OR — show posts which match one or more settings', 'the-post-grid' ),
71 ];
72 }
73
74 public static function rtMetaKeyType() {
75 return [
76 'meta_value' => esc_html__( 'Meta value', 'the-post-grid' ), //phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value
77 'meta_value_num' => esc_html__( 'Meta value number', 'the-post-grid' ),
78 'meta_value_datetime' => esc_html__( 'Meta value datetime', 'the-post-grid' ),
79 ];
80 }
81
82 public static function rtPostOrderBy( $isWoCom = false, $metaOrder = false ) {
83 $orderBy = [
84 'title' => esc_html__( 'Title', 'the-post-grid' ),
85 'date' => esc_html__( 'Created date', 'the-post-grid' ),
86 'modified' => esc_html__( 'Modified date', 'the-post-grid' ),
87 'menu_order' => esc_html__( 'Menu Order', 'the-post-grid' ),
88 ];
89
90 return apply_filters( 'rt_tpg_post_orderby', $orderBy, $isWoCom, $metaOrder );
91 }
92
93 public static function rtTPGSettingsCustomScriptFields() {
94 $settings = get_option( rtTPG()->options['settings'] );
95
96 return [
97 'script_before_item_load' => [
98 'label' => esc_html__( 'Script before item load', 'the-post-grid' ),
99 'type' => 'textarea',
100 'holderClass' => 'rt-script-wrapper full',
101 'id' => 'script-before-item-load',
102 'value' => isset( $settings['script_before_item_load'] ) ? stripslashes( $settings['script_before_item_load'] ) : null,
103 ],
104 'script_after_item_load' => [
105 'label' => esc_html__( 'Script After item load', 'the-post-grid' ),
106 'type' => 'textarea',
107 'holderClass' => 'rt-script-wrapper full',
108 'id' => 'script-after-item-load',
109 'value' => isset( $settings['script_after_item_load'] ) ? stripslashes( $settings['script_after_item_load'] ) : null,
110 ],
111 'script_loaded' => [
112 'label' => esc_html__( 'After Loaded script', 'the-post-grid' ),
113 'type' => 'textarea',
114 'holderClass' => 'rt-script-wrapper full',
115 'id' => 'script-loaded',
116 'value' => isset( $settings['script_loaded'] ) ? stripslashes( $settings['script_loaded'] ) : null,
117 ],
118 ];
119 }
120
121 public static function rtTPGSettingsOtherSettingsFields() {
122 $settings = get_option( rtTPG()->options['settings'] );
123
124 $other_settings = [
125 'template_author' => [
126 'type' => 'select',
127 'name' => 'template_author',
128 'label' => esc_html__( 'Template Author', 'the-post-grid' ),
129 'id' => 'template_author',
130 'holderClass' => 'pro-field',
131 'class' => 'select2',
132 'blank' => 'Select a layout',
133 'options' => Fns::getTPGShortCodeList(),
134 'value' => isset( $settings['template_author'] ) ? $settings['template_author'] : [],
135 ],
136 'template_category' => [
137 'type' => 'select',
138 'name' => 'template_category',
139 'label' => esc_html__( 'Template Category', 'the-post-grid' ),
140 'id' => 'template_category',
141 'holderClass' => 'pro-field',
142 'class' => 'select2',
143 'blank' => 'Select a layout',
144 'options' => Fns::getTPGShortCodeList(),
145 'value' => isset( $settings['template_category'] ) ? $settings['template_category'] : [],
146 ],
147 'template_search' => [
148 'type' => 'select',
149 'name' => 'template_search',
150 'label' => esc_html__( 'Template Search', 'the-post-grid' ),
151 'id' => 'template_search',
152 'holderClass' => 'pro-field',
153 'class' => 'select2',
154 'blank' => 'Select a layout',
155 'options' => Fns::getTPGShortCodeList(),
156 'value' => isset( $settings['template_search'] ) ? $settings['template_search'] : [],
157 ],
158 'template_tag' => [
159 'type' => 'select',
160 'name' => 'template_tag',
161 'label' => esc_html__( 'Template Tag', 'the-post-grid' ),
162 'id' => 'template_tag',
163 'holderClass' => 'pro-field',
164 'class' => 'select2',
165 'blank' => 'Select a layout',
166 'options' => Fns::getTPGShortCodeList(),
167 'value' => isset( $settings['template_tag'] ) ? $settings['template_tag'] : [],
168 ],
169
170 'tpg_primary_color_main' => [
171 'type' => 'text',
172 'label' => esc_html__( 'Primary Color', 'the-post-grid' ),
173 'class' => 'rt-color',
174 'default' => isset( $settings['tpg_primary_color_main'] ) ? $settings['tpg_primary_color_main'] : '#0d6efd',
175 ],
176
177 'tpg_secondary_color_main' => [
178 'type' => 'text',
179 'label' => esc_html__( 'Secondary Color', 'the-post-grid' ),
180 'class' => 'rt-color',
181 'default' => isset( $settings['tpg_secondary_color_main'] ) ? $settings['tpg_secondary_color_main'] : '#0654c4',
182 ],
183
184 'tpg_loader_color' => [
185 'type' => 'text',
186 'label' => esc_html__( 'Preloader Color', 'the-post-grid' ),
187 'class' => 'rt-color',
188 'default' => isset( $settings['tpg_loader_color'] ) ? $settings['tpg_loader_color'] : '#0367bf',
189 ],
190
191 'template_class' => [
192 'type' => 'text',
193 'name' => 'template_class',
194 'label' => esc_html__( 'Template class', 'the-post-grid' ),
195 'holderClass' => 'pro-field',
196 'id' => 'template_class',
197 'value' => isset( $settings['template_class'] ) ? $settings['template_class'] : '',
198 ],
199 ];
200
201 $insert_array = [
202 'tpg_popupbar_color' => [
203 'type' => 'text',
204 'label' => esc_html__( 'Popup Topbar Color', 'the-post-grid' ),
205 'class' => 'rt-color',
206 'default' => isset( $settings['tpg_popupbar_color'] ) ? $settings['tpg_popupbar_color'] : '',
207 ],
208 'tpg_popupbar_bg_color' => [
209 'type' => 'text',
210 'label' => esc_html__( 'Popup Background Color', 'the-post-grid' ),
211 'class' => 'rt-color',
212 'default' => isset( $settings['tpg_popupbar_bg_color'] ) ? $settings['tpg_popupbar_bg_color'] : '',
213 ],
214 'tpg_popupbar_text_color' => [
215 'type' => 'text',
216 'label' => esc_html__( 'Popup Text Color', 'the-post-grid' ),
217 'class' => 'rt-color',
218 'default' => isset( $settings['tpg_popupbar_text_color'] ) ? $settings['tpg_popupbar_text_color'] : '',
219 ],
220 ];
221
222 Fns::array_insert( $other_settings, 6, $insert_array );
223
224 $plugin = Fns::is_acf();
225
226 if ( $plugin ) {
227 $acf_settings = [
228 'show_acf_details' => [
229 'type' => 'switch',
230 'name' => 'show_acf_details',
231 'label' => esc_html__( 'Enable Advanced Custom Field (ACF) for Single page', 'the-post-grid' ),
232 'description' => esc_html__( 'You may enable advanced custom field (ACF) on details page', 'the-post-grid' ),
233 'holderClass' => 'pro-field',
234 'value' => isset( $settings['show_acf_details'] ) ? $settings['show_acf_details'] : false,
235 ],
236
237 'cf_group_details' => [
238 'type' => 'checkbox',
239 'name' => 'cf_group_details',
240 'label' => esc_html__( 'Choose ACF Group', 'the-post-grid' ),
241 'id' => 'cf_group_details',
242 'holderClass' => 'pro-field',
243 'alignment' => 'vertical',
244 'multiple' => true,
245 'options' => Fns::get_groups_by_post_type( 'all' ),
246 'value' => isset( $settings['cf_group_details'] ) ? $settings['cf_group_details'] : [],
247 ],
248
249 'cf_hide_empty_value_details' => [
250 'type' => 'switch',
251 'name' => 'cf_hide_empty_value_details',
252 'label' => esc_html__( 'Hide field with empty value', 'the-post-grid' ),
253 'value' => isset( $settings['cf_hide_empty_value_details'] ) ? $settings['cf_hide_empty_value_details'] : false,
254 'holderClass' => 'pro-field',
255 ],
256
257 'cf_show_only_value_details' => [
258 'type' => 'switch',
259 'name' => 'cf_show_only_value_details',
260 'label' => esc_html__( 'Show Title', 'the-post-grid' ),
261 'description' => esc_html__( 'By default both name & value of field is shown', 'the-post-grid' ),
262 'value' => isset( $settings['cf_show_only_value_details'] ) ? $settings['cf_show_only_value_details'] : true,
263 'holderClass' => 'pro-field',
264 ],
265
266 'cf_hide_group_title_details' => [
267 'type' => 'switch',
268 'name' => 'cf_hide_group_title_details',
269 'label' => esc_html__( 'Show group title', 'the-post-grid' ),
270 'value' => isset( $settings['cf_hide_group_title_details'] ) ? $settings['cf_hide_group_title_details'] : false,
271 'holderClass' => 'pro-field',
272 ],
273 ];
274
275 $other_settings = array_merge( $other_settings, $acf_settings );
276 }
277
278 return $other_settings;
279 }
280
281 public static function rtTPGChatGPGSettings() {
282 $settings = get_option( rtTPG()->options['settings'] );
283
284 $other_settings = [
285
286 'chatgpt_status' => [
287 'type' => 'switch',
288 'name' => 'chatgpt_status',
289 'label' => esc_html__( 'Enable ChatGPT', 'the-post-grid' ),
290 'value' => isset( $settings['chatgpt_status'] ) ? $settings['chatgpt_status'] : false,
291 ],
292
293 'chatgpt_secret_key' => [
294 'type' => 'text',
295 'name' => 'chatgpt_secret_key',
296 'label' => esc_html__( 'OpenAI API Secret Key', 'the-post-grid' ),
297 'id' => 'template_author',
298 'holderClass' => 'pro-field',
299 'description' => __( 'Enter the OpenAI API Secret Key <a target="_blank" href="https://platform.openai.com/account/api-keys">Make your own API</a>', 'the-post-grid' ),
300 'value' => isset( $settings['chatgpt_secret_key'] ) ? $settings['chatgpt_secret_key'] : '',
301 ],
302 'chatgpt_model' => [
303 'type' => 'select',
304 'name' => 'chatgpt_model',
305 'label' => esc_html__( 'OpenAI Model', 'the-post-grid' ),
306 'id' => 'chatgpt_model',
307 'holderClass' => 'pro-field',
308 'class' => 'select2',
309 'description' => __( 'Choose OpenAI model. Default: gpt-3.5-turbo', 'the-post-grid' ),
310 'options' => [
311 'gpt-3.5-turbo' => 'gpt-3.5-turbo',
312 'text-davinci-002' => 'text-davinci-002',
313 'text-davinci-003' => 'text-davinci-003',
314 'gpt-4' => 'gpt-4',
315 ],
316 'value' => isset( $settings['chatgpt_model'] ) ? $settings['chatgpt_model'] : 'gpt-3.5-turbo',
317 ],
318 'chatgpt_response_time' => [
319 'type' => 'number',
320 'name' => 'chatgpt_response_time',
321 'label' => esc_html__( 'Response Time', 'the-post-grid' ),
322 'id' => 'chatgpt_response_time',
323 'holderClass' => 'pro-field',
324 'description' => __( 'Choose OpenAI response time', 'the-post-grid' ),
325 'value' => isset( $settings['chatgpt_response_time'] ) ? $settings['chatgpt_response_time'] : 60,
326 ],
327 'chatgpt_max_tokens' => [
328 'type' => 'number',
329 'name' => 'chatgpt_max_tokens',
330 'label' => esc_html__( 'Max Tokens', 'the-post-grid' ),
331 'id' => 'chatgpt_max_tokens',
332 'holderClass' => 'pro-field',
333 'description' => __( 'Enter OpenAi max token number', 'the-post-grid' ),
334 'value' => isset( $settings['chatgpt_max_tokens'] ) ? $settings['chatgpt_max_tokens'] : 1200,
335 ],
336
337 ];
338
339 return $other_settings;
340 }
341
342
343 public static function rtTPGCMyAccountSettings() {
344 $settings = get_option( rtTPG()->options['settings'] );
345
346 $other_settings = [
347
348 'tpg_myaccount' => [
349 'type' => 'select',
350 'name' => 'tpg_myaccount',
351 'label' => 'My Account Page',
352 'id' => 'tpg_myaccount',
353 'class' => 'select2',
354 'options' => Fns::get_pages(),
355 'description' => esc_html__( 'Choose My Account Page. Use must use the shortcode [tpg_my_account] in the page.', 'the-post-grid' ),
356 'value' => isset( $settings['tpg_myaccount'] ) ? $settings['tpg_myaccount'] : '',
357 ],
358
359 'post_status' => [
360 'type' => 'select',
361 'name' => 'post_status',
362 'label' => esc_html__( 'Post Status', 'the-post-grid' ),
363 'id' => 'post_status',
364 'holderClass' => 'pro-field',
365 'class' => 'select2',
366 'description' => __( 'Submitted Post Status', 'the-post-grid' ),
367 'options' => [
368 'pending' => esc_html__( 'Pending Review', 'the-post-grid' ),
369 'draft' => esc_html__( 'Draft', 'the-post-grid' ),
370 'private' => esc_html__( 'Private', 'the-post-grid' ),
371 'publish' => esc_html__( 'Publish', 'the-post-grid' ),
372 ],
373 'value' => isset( $settings['post_status'] ) ? $settings['post_status'] : 'pending',
374 ],
375
376 'max_upload_file' => [
377 'type' => 'text',
378 'name' => 'max_upload_file',
379 'label' => esc_html__( 'Max Image Size', 'the-post-grid' ),
380 'id' => 'max_upload_file',
381 'holderClass' => 'pro-field',
382 'description' => __( 'Input max upload image size by byte. Default is: 1048576 (1MB)', 'the-post-grid' ),
383 'options' => [
384 'pending' => esc_html__( 'Pending Review', 'the-post-grid' ),
385 'draft' => esc_html__( 'Draft', 'the-post-grid' ),
386 'private' => esc_html__( 'Private', 'the-post-grid' ),
387 'publish' => esc_html__( 'Publish', 'the-post-grid' ),
388 ],
389 'value' => isset( $settings['max_upload_file'] ) ? $settings['max_upload_file'] : '1048576',
390 ],
391
392 'delete_post_status' => [
393 'type' => 'select',
394 'name' => 'delete_post_status',
395 'label' => esc_html__( 'Deleted Post', 'the-post-grid' ),
396 'id' => 'delete_post_status',
397 'holderClass' => 'pro-field',
398 'class' => 'select2',
399 'description' => __( 'What will it happen when the user delete the post?', 'the-post-grid' ),
400 'options' => [
401 'trash' => esc_html__( 'Go to Trash', 'the-post-grid' ),
402 'delete' => esc_html__( 'Delete Forever', 'the-post-grid' ),
403 ],
404 'value' => isset( $settings['delete_post_status'] ) ? $settings['delete_post_status'] : 'trash',
405 ],
406
407 ];
408
409 return $other_settings;
410 }
411
412 public static function rtTPGSettingsCommonSettingsFields() {
413 $settings = get_option( rtTPG()->options['settings'] );
414
415 $common_settings = [
416 'tpg_common_settings_heading' => [
417 'type' => 'heading',
418 'name' => 'tpg_common_settings_heading',
419 'class' => 'tpg_common_settings_heading',
420 'label' => esc_html__( 'Improve Performance', 'the-post-grid' ),
421 'description' => esc_html__( 'Please choose a Resource Load Type first. Otherwise, all CSS & JS for shortcode, gutenberg and elementor will load on your site which can create a bad performance issues.', 'the-post-grid' ),
422 ],
423
424 'tpg_block_type' => [
425 'type' => 'select',
426 'name' => 'tpg_block_type',
427 'label' => 'Resource Load Type',
428 'id' => 'tpg_block_type',
429 'class' => 'select2',
430 'options' => [
431 'default' => esc_html__( 'Default (Shortcode add Elementor / Gutenberg)', 'the-post-grid' ),
432 'elementor' => esc_html__( 'Elementor / Gutenberg', 'the-post-grid' ),
433 'shortcode' => esc_html__( 'Shortcode Only', 'the-post-grid' ),
434 ],
435 'description' => esc_html__( 'Please choose which type of block you want to use. If you select Default then all styles and scripts will load on your site. But if you use one then just this style and script will load on your site.', 'the-post-grid' ),
436 'value' => isset( $settings['tpg_block_type'] ) ? $settings['tpg_block_type'] : 'default',
437 ],
438 'tpg_load_script' => [
439 'type' => 'switch',
440 'name' => 'tpg_load_script',
441 'label' => esc_html__( 'Load Script dependent on block', 'the-post-grid' ),
442 'description' => sprintf(
443 '%s<b>%s</b>',
444 esc_html__( 'Check, if you want to load script when ShortCode or Elementor block is used on a page. ', 'the-post-grid' ),
445 esc_html__( 'If you enable this then you must have to enable Preloader from below.', 'the-post-grid' )
446 ),
447 'value' => isset( $settings['tpg_load_script'] ) ? $settings['tpg_load_script'] : false,
448 ],
449 'tpg_enable_preloader' => [
450 'type' => 'switch',
451 'name' => 'tpg_enable_preloader',
452 'label' => esc_html__( 'Enable Pre-loader', 'the-post-grid' ),
453 'value' => isset( $settings['tpg_enable_preloader'] ) ? $settings['tpg_enable_preloader'] : false,
454 ],
455 'tpg_skip_fa' => [
456 'type' => 'switch',
457 'name' => 'tpg_skip_fa',
458 'label' => esc_html__( 'Disable Font Awesome Script', 'the-post-grid' ),
459 'description' => esc_html__( "If Font Awesome 5 exist with theme, don't need to load twice.", 'the-post-grid' ),
460 'value' => isset( $settings['tpg_skip_fa'] ) ? $settings['tpg_skip_fa'] : false,
461 ],
462 'tpg_icon_font' => [
463 'type' => 'select',
464 'name' => 'tpg_icon_font',
465 'label' => 'Icon Type',
466 'id' => 'tpg_icon_font',
467 'class' => 'select2',
468 'options' => [
469 'fontawesome' => esc_html__( 'Fontawesome Icon', 'the-post-grid' ),
470 'flaticon' => esc_html__( 'Flat icon', 'the-post-grid' ),
471 ],
472 'description' => esc_html__( 'You can change icon font from here', 'the-post-grid' ),
473 'value' => isset( $settings['tpg_icon_font'] ) ? $settings['tpg_icon_font'] : 'fontawesome',
474 ],
475
476 'tpg_pagination_range' => [
477 'type' => 'number',
478 'label' => esc_html__( 'Pagination Range', 'the-post-grid' ),
479 'description' => esc_html__( 'If the pagination items are greater than 4 it will enable the next and previous button.', 'the-post-grid' ),
480 'value' => $settings['tpg_pagination_range'] ?? '4',
481 ],
482 ];
483
484 return $common_settings;
485 }
486
487 public static function rtTPGLicenceField() {
488 $settings = get_option( rtTPG()->options['settings'] );
489 $status = ! empty( $settings['license_status'] ) && $settings['license_status'] === 'valid' ? true : false;
490 $license_status = ! empty( $settings['license_key'] ) ? sprintf(
491 "<span class='license-status'>%s</span>",
492 $status
493 ? "<input type='submit' class='button-secondary rt-licensing-btn danger' name='license_deactivate' value='" . esc_html__( 'Deactivate License', 'the-post-grid' ) . "'/>"
494 : "<input type='submit' class='button-secondary rt-licensing-btn button-primary' name='license_activate' value='" . esc_html__( 'Activate License', 'the-post-grid' ) . "'/>"
495 ) : ' ';
496
497 return [
498 'license_key' => [
499 'type' => 'text',
500 'name' => 'license_key',
501 'attr' => 'style="min-width:300px;"',
502 'label' => esc_html__( 'Enter your license key', 'the-post-grid' ),
503 'description_adv' => Fns::htmlKses( $license_status, 'advanced' ),
504 'id' => 'license_key',
505 'value' => isset( $settings['license_key'] ) ? $settings['license_key'] : '',
506 ],
507 ];
508 }
509
510 public static function rtTPGSettingsSocialShareFields() {
511 $settings = get_option( rtTPG()->options['settings'] );
512
513 return [
514 'social_share_items' => [
515 'type' => 'checkbox',
516 'name' => 'social_share_items',
517 'label' => esc_html__( 'Social share items', 'the-post-grid' ),
518 'id' => 'social_share_items',
519 'holderClass' => 'pro-field',
520 'alignment' => 'vertical',
521 'multiple' => true,
522 'options' => self::socialShareItemList(),
523 'value' => isset( $settings['social_share_items'] ) ? $settings['social_share_items'] : [],
524 ],
525 ];
526 }
527
528 public static function socialShareItemList() {
529 return [
530 'facebook' => esc_html__( 'Facebook', 'the-post-grid' ),
531 'twitter' => esc_html__( 'Twitter', 'the-post-grid' ),
532 'linkedin' => esc_html__( 'LinkedIn', 'the-post-grid' ),
533 'pinterest' => esc_html__( 'Pinterest', 'the-post-grid' ),
534 'reddit' => esc_html__( 'Reddit', 'the-post-grid' ),
535 'email' => esc_html__( 'Email', 'the-post-grid' ),
536 ];
537 }
538
539 public static function templateOverrideItemList() {
540 return [
541 'category-archive' => esc_html__( 'Category archive', 'the-post-grid' ),
542 'tag-archive' => esc_html__( 'Tag archive', 'the-post-grid' ),
543 'author-archive' => esc_html__( 'Author archive', 'the-post-grid' ),
544 'search' => esc_html__( 'Search page', 'the-post-grid' ),
545 ];
546 }
547
548 public static function rtTPGCommonFilterFields() {
549 return [
550 'post__in' => [
551 'name' => 'post__in',
552 'label' => esc_html__( 'Include only', 'the-post-grid' ),
553 'type' => 'text',
554 'class' => 'full',
555 'description' => esc_html__( 'List of post IDs to show (comma-separated values, for example: 1,2,3)', 'the-post-grid' ),
556 ],
557 'post__not_in' => [ //phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in
558 'name' => 'post__not_in',
559 'label' => esc_html__( 'Exclude', 'the-post-grid' ),
560 'type' => 'text',
561 'class' => 'full',
562 'description' => esc_html__( 'List of post IDs to hide (comma-separated values, for example: 1,2,3)', 'the-post-grid' ),
563 ],
564 'limit' => [
565 'name' => 'limit',
566 'label' => esc_html__( 'Limit', 'the-post-grid' ),
567 'type' => 'number',
568 'class' => 'full',
569 'description' => esc_html__( 'The number of posts to show. Set empty to show all found posts.', 'the-post-grid' ),
570 ],
571 'offset' => [
572 'name' => 'offset',
573 'label' => esc_html__( 'Offset', 'the-post-grid' ),
574 'type' => 'number',
575 'class' => 'full',
576 'description' => esc_html__( 'The number of posts to skip from start', 'the-post-grid' ),
577 ],
578 ];
579 }
580
581 public static function rtTPGPostType() {
582 return [
583 'tpg_post_type' => [
584 'label' => esc_html__( 'Post Type', 'the-post-grid' ),
585 'type' => 'select',
586 'id' => 'rt-sc-post-type',
587 'class' => '-rt-select2',
588 'options' => self::rtPostTypes(),
589 ],
590 ];
591 }
592
593 public static function rtTPAdvanceFilters() {
594 $fields = apply_filters(
595 'rt_tpg_advanced_filters',
596 [
597 'tpg_taxonomy' => esc_html__( 'Taxonomy', 'the-post-grid' ),
598 'order' => esc_html__( 'Order', 'the-post-grid' ),
599 'author' => esc_html__( 'Author', 'the-post-grid' ),
600 'tpg_post_status' => esc_html__( 'Status', 'the-post-grid' ),
601 's' => esc_html__( 'Search', 'the-post-grid' ),
602 ]
603 );
604
605 return [
606 'post_filter' => [
607 'type' => 'checkboxFilter',
608 'name' => 'post_filter',
609 'label' => esc_html__( 'Advanced Filters', 'the-post-grid' ),
610 'alignment' => 'vertical',
611 'multiple' => true,
612 'default' => [ 'tpg_taxonomy', 'order' ],
613 'options' => $fields,
614 ],
615 ];
616 }
617
618 public static function rtTPGPostStatus() {
619 return [
620 'publish' => esc_html__( 'Publish', 'the-post-grid' ),
621 'pending' => esc_html__( 'Pending', 'the-post-grid' ),
622 'draft' => esc_html__( 'Draft', 'the-post-grid' ),
623 'auto-draft' => esc_html__( 'Auto draft', 'the-post-grid' ),
624 'future' => esc_html__( 'Future', 'the-post-grid' ),
625 'private' => esc_html__( 'Private', 'the-post-grid' ),
626 'inherit' => esc_html__( 'Inherit', 'the-post-grid' ),
627 'trash' => esc_html__( 'Trash', 'the-post-grid' ),
628 ];
629 }
630
631 public static function owl_property() {
632 return [
633 'auto_play' => esc_html__( 'Auto Play', 'the-post-grid' ),
634 'loop' => esc_html__( 'Loop', 'the-post-grid' ),
635 'nav_button' => esc_html__( 'Nav Button', 'the-post-grid' ),
636 'pagination' => esc_html__( 'Pagination', 'the-post-grid' ),
637 'stop_hover' => esc_html__( 'Stop Hover', 'the-post-grid' ),
638 'auto_height' => esc_html__( 'Auto Height', 'the-post-grid' ),
639 'lazy_load' => esc_html__( 'Lazy Load', 'the-post-grid' ),
640 'rtl' => esc_html__( 'Right to left (RTL)', 'the-post-grid' ),
641 ];
642 }
643
644 public static function rtTPGLayoutSettingFields() {
645 $options = [
646 'layout_type' => [
647 'type' => 'radio-image',
648 'label' => esc_html__( 'Layout Type', 'the-post-grid' ),
649 'id' => 'rt-tpg-sc-layout-type',
650 'options' => self::rtTPGLayoutType(),
651 ],
652 'layout' => [
653 'type' => 'radio-image',
654 'label' => esc_html__( 'Layout', 'the-post-grid' ),
655 'id' => 'rt-tpg-sc-layout',
656 'class' => 'rt-select2',
657 'options' => self::rtTPGLayouts(),
658 ],
659 'tgp_filter' => [
660 'type' => 'checkbox',
661 'label' => esc_html__( 'Filter', 'the-post-grid' ),
662 'holderClass' => 'sc-tpg-grid-filter tpg-hidden pro-field',
663 'multiple' => true,
664 'alignment' => 'vertical',
665 'options' => self::tgp_filter_list(),
666 ],
667 'tgp_filter_taxonomy' => [
668 'type' => 'select',
669 'label' => esc_html__( 'Taxonomy Filter', 'the-post-grid' ),
670 'holderClass' => 'sc-tpg-grid-filter sc-tpg-filter tpg-hidden',
671 'class' => 'rt-select2',
672 'options' => Fns::rt_get_taxonomy_for_filter(),
673 ],
674 'tgp_filter_taxonomy_hierarchical' => [
675 'type' => 'switch',
676 'label' => esc_html__( 'Display as sub category', 'the-post-grid' ),
677 'holderClass' => 'sc-tpg-grid-filter sc-tpg-filter tpg-hidden',
678 'option' => 'Active',
679 ],
680 'tgp_filter_type' => [
681 'type' => 'select',
682 'label' => esc_html__( 'Taxonomy filter type', 'the-post-grid' ),
683 'holderClass' => 'sc-tpg-grid-filter sc-tpg-filter tpg-hidden',
684 'class' => 'rt-select2',
685 'options' => self::rt_filter_type(),
686 ],
687 'tgp_default_filter' => [
688 'type' => 'select',
689 'label' => esc_html__( 'Selected filter term (Selected item)', 'the-post-grid' ),
690 'holderClass' => 'sc-tpg-grid-filter sc-tpg-filter tpg-hidden',
691 'class' => 'rt-select2',
692 'attr' => "data-selected='" . get_post_meta( get_the_ID(), 'tgp_default_filter', true ) . "'",
693 'options' => [ '' => esc_html__( 'Show All', 'the-post-grid' ) ],
694 ],
695 'tpg_hide_all_button' => [
696 'type' => 'switch',
697 'label' => esc_html__( 'Hide All (Show all) button', 'the-post-grid' ),
698 'holderClass' => 'sc-tpg-grid-filter sc-tpg-filter tpg-hidden',
699 'option' => 'Hide',
700 ],
701 'tpg_post_count' => [
702 'type' => 'switch',
703 'label' => esc_html__( 'Show post count', 'the-post-grid' ),
704 'holderClass' => 'sc-tpg-grid-filter sc-tpg-filter tpg-hidden',
705 'option' => 'Enable',
706 ],
707 'isotope_filter' => [
708 'type' => 'select',
709 'label' => esc_html__( 'Isotope Filter', 'the-post-grid' ),
710 'holderClass' => 'isotope-item sc-isotope-filter tpg-hidden',
711 'id' => 'rt-tpg-sc-isotope-filter',
712 'class' => 'rt-select2',
713 'options' => Fns::rt_get_taxonomy_for_filter(),
714 ],
715 'isotope_default_filter' => [
716 'type' => 'select',
717 'label' => esc_html__( 'Isotope filter (Selected item)', 'the-post-grid' ),
718 'holderClass' => 'isotope-item sc-isotope-default-filter tpg-hidden pro-field',
719 'id' => 'rt-tpg-sc-isotope-default-filter',
720 'class' => 'rt-select2',
721 'attr' => "data-selected='" . get_post_meta(
722 get_the_ID(),
723 'isotope_default_filter',
724 true
725 ) . "'",
726 'options' => [ '' => esc_html__( 'Show all', 'the-post-grid' ) ],
727 ],
728 'tpg_show_all_text' => [
729 'type' => 'text',
730 'holderClass' => 'isotope-item sc-isotope-filter tpg-hidden',
731 'label' => esc_html__( 'Show all text', 'the-post-grid' ),
732 'default' => esc_html__( 'Show all', 'the-post-grid' ),
733 ],
734 'isotope_filter_dropdown' => [
735 'type' => 'switch',
736 'label' => esc_html__( 'Isotope dropdown filter', 'the-post-grid' ),
737 'holderClass' => 'isotope-item sc-isotope-filter sc-isotope-filter-dropdown tpg-hidden pro-field',
738 ],
739 'isotope_filter_show_all' => [
740 'type' => 'switch',
741 'name' => 'isotope_filter_show_all',
742 'label' => esc_html__( 'Hide Isotope filter (Show All item)', 'the-post-grid' ),
743 'holderClass' => 'isotope-item sc-isotope-filter-show-all tpg-hidden pro-field',
744 'id' => 'rt-tpg-sc-isotope-filter-show-all',
745 ],
746 'isotope_filter_count' => [
747 'type' => 'switch',
748 'label' => esc_html__( 'Isotope filter count number', 'the-post-grid' ),
749 'holderClass' => 'isotope-item sc-isotope-filter tpg-hidden pro-field',
750 'option' => 'Enable',
751 ],
752 'isotope_filter_url' => [
753 'type' => 'switch',
754 'label' => esc_html__( 'Isotope filter URL', 'the-post-grid' ),
755 'holderClass' => 'isotope-item sc-isotope-filter tpg-hidden pro-field',
756 ],
757 'isotope_search_filter' => [
758 'type' => 'switch',
759 'label' => esc_html__( 'Isotope search filter', 'the-post-grid' ),
760 'holderClass' => 'isotope-item sc-isotope-search-filter tpg-hidden pro-field',
761 'id' => 'rt-tpg-sc-isotope-search-filter',
762 'option' => 'Enable',
763 ],
764 'carousel_property' => [
765 'type' => 'checkbox',
766 'label' => esc_html__( 'Carousel property', 'the-post-grid' ),
767 'multiple' => true,
768 'alignment' => 'vertical',
769 'holderClass' => 'carousel-item carousel-property tpg-hidden',
770 'id' => 'carousel-property',
771 'default' => [ 'pagination' ],
772 'options' => self::owl_property(),
773 ],
774 'tpg_carousel_speed' => [
775 'label' => esc_html__( 'Speed', 'the-post-grid' ),
776 'holderClass' => 'tpg-hidden carousel-item',
777 'type' => 'number',
778 'default' => 250,
779 'description' => esc_html__( 'Auto play Speed in milliseconds', 'the-post-grid' ),
780 ],
781 'tpg_carousel_autoplay_timeout' => [
782 'label' => esc_html__( 'Autoplay timeout', 'the-post-grid' ),
783 'holderClass' => 'tpg-hidden carousel-item tpg-carousel-auto-play-timeout',
784 'type' => 'number',
785 'default' => 5000,
786 'description' => esc_html__( 'Autoplay interval timeout', 'the-post-grid' ),
787 ],
788 ];
789
790 return apply_filters( 'rt_tpg_layout_options', $options );
791 }
792
793 public static function responsiveSettingsColumn() {
794 $options = [
795 'column' => [
796 'type' => 'select',
797 'label' => esc_html__( 'Desktop', 'the-post-grid' ),
798 'class' => 'rt-select2',
799 'holderClass' => 'offset-column-wrap rt-3-column',
800 'default' => 3,
801 'options' => self::scColumns(),
802 'description' => esc_html__( 'Desktop > 991px', 'the-post-grid' ),
803 ],
804 'tpg_tab_column' => [
805 'type' => 'select',
806 'label' => esc_html__( 'Tab', 'the-post-grid' ),
807 'class' => 'rt-select2',
808 'holderClass' => 'offset-column-wrap rt-3-column',
809 'default' => 2,
810 'options' => self::scColumns(),
811 'description' => esc_html__( 'Tab < 992px', 'the-post-grid' ),
812 ],
813 'tpg_mobile_column' => [
814 'type' => 'select',
815 'label' => esc_html__( 'Mobile', 'the-post-grid' ),
816 'class' => 'rt-select2',
817 'holderClass' => 'offset-column-wrap rt-3-column',
818 'default' => 1,
819 'options' => self::scColumns(),
820 'description' => esc_html__( 'Mobile < 768px', 'the-post-grid' ),
821 ],
822 ];
823
824 return apply_filters( 'rt_tpg_layout_column_options', $options );
825 }
826
827 public static function layoutMiscSettings() {
828 $options = [
829 'pagination' => [
830 'type' => 'switch',
831 'label' => esc_html__( 'Pagination', 'the-post-grid' ),
832 'holderClass' => 'pagination',
833 'id' => 'rt-tpg-pagination',
834 'description' => esc_html__( 'Pagination not allow in Grid Hover layout', 'the-post-grid' ),
835 'option' => 'Enable',
836 'default' => 1,
837 ],
838 'posts_per_page' => [
839 'type' => 'number',
840 'label' => esc_html__( 'Display per page', 'the-post-grid' ),
841 'holderClass' => 'pagination-item posts-per-page tpg-hidden',
842 'default' => 9,
843 'description' => esc_html__( 'If value of Limit setting is not blank (empty), this value should be smaller than Limit value.', 'the-post-grid' ),
844 ],
845 'posts_loading_type' => [
846 'type' => 'radio',
847 'label' => esc_html__( 'Pagination Type', 'the-post-grid' ),
848 'holderClass' => 'pagination-item posts-loading-type tpg-hidden pro-field',
849 'alignment' => 'vertical',
850 'default' => 'pagination',
851 'options' => self::postLoadingType(),
852 ],
853
854 'load_more_text' => [
855 'type' => 'text',
856 'name' => 'load_more_text',
857 'label' => esc_html__( 'Load More Text', 'the-post-grid' ),
858 'holderClass' => 'pagination-load-more-label tpg-hidden pro-field',
859 'id' => 'template_class',
860 'value' => isset( $settings['load_more_text'] ) ? $settings['load_more_text'] : '',
861 ],
862
863 'link_to_detail_page' => [
864 'type' => 'switch',
865 'label' => esc_html__( 'Link To Detail Page', 'the-post-grid' ),
866 'alignment' => 'vertical',
867 'default' => true,
868 ],
869 'detail_page_link_type' => [
870 'type' => 'radio',
871 'label' => esc_html__( 'Detail page link type', 'the-post-grid' ),
872 'holderClass' => 'detail-page-link-type tpg-hidden pro-field',
873 'alignment' => 'vertical',
874 'default' => 'new_page',
875 'options' => [
876 'new_page' => esc_html__( 'New Page', 'the-post-grid' ),
877 'popup' => esc_html__( 'PopUp', 'the-post-grid' ),
878 ],
879 ],
880 'popup_type' => [
881 'type' => 'radio',
882 'label' => esc_html__( 'PopUp Type', 'the-post-grid' ),
883 'holderClass' => 'popup-type tpg-hidden pro-field',
884 'alignment' => 'vertical',
885 'default' => 'single',
886 'options' => [
887 'single' => esc_html__( 'Single PopUp', 'the-post-grid' ),
888 'multi' => esc_html__( 'Multi PopUp', 'the-post-grid' ),
889 ],
890 ],
891 'link_target' => [
892 'type' => 'radio',
893 'label' => esc_html__( 'Link Target', 'the-post-grid' ),
894 'holderClass' => 'tpg-link-target tpg-hidden',
895 'alignment' => 'vertical',
896 'options' => [
897 '' => esc_html__( 'Same Window', 'the-post-grid' ),
898 '_blank' => esc_html__( 'New Window', 'the-post-grid' ),
899 ],
900 ],
901 ];
902
903 return apply_filters( 'rt_tpg_layout_misc_options', $options );
904 }
905
906 public static function stickySettings() {
907 $options = [
908 'ignore_sticky_posts' => [
909 'type' => 'switch',
910 'label' => esc_html__( 'Show sticky posts at the top', 'the-post-grid' ),
911 'holderClass' => 'pro-field',
912 'alignment' => 'vertical',
913 'default' => false,
914 ],
915 ];
916
917 return $options;
918 }
919
920 public static function scMarginOpt() {
921 return [
922 'default' => esc_html__( 'Bootstrap default', 'the-post-grid' ),
923 'no' => esc_html__( 'No Margin', 'the-post-grid' ),
924 ];
925 }
926
927 function scGridType() {
928 return [
929 'even' => esc_html__( 'Even Grid', 'the-post-grid' ),
930 'masonry' => esc_html__( 'Masonry', 'the-post-grid' ),
931 ];
932 }
933
934 public static function getTitleTags() {
935 return [
936 'h2' => esc_html__( 'H2', 'the-post-grid' ),
937 'h3' => esc_html__( 'H3', 'the-post-grid' ),
938 'h4' => esc_html__( 'H4', 'the-post-grid' ),
939 ];
940 }
941
942 public static function getHeadingTags() {
943 return [
944 'h1' => esc_html__( 'H1', 'the-post-grid' ),
945 'h2' => esc_html__( 'H2', 'the-post-grid' ),
946 'h3' => esc_html__( 'H3', 'the-post-grid' ),
947 'h4' => esc_html__( 'H4', 'the-post-grid' ),
948 'h5' => esc_html__( 'H5', 'the-post-grid' ),
949 'h6' => esc_html__( 'H6', 'the-post-grid' ),
950 ];
951 }
952
953 public static function rtTpgSettingsDetailFieldSelection() {
954 $settings = get_option( rtTPG()->options['settings'] );
955
956 $fields = [
957 'popup_fields' => [
958 'type' => 'checkbox',
959 'label' => esc_html__( 'Field Selection', 'the-post-grid' ),
960 'id' => 'popup-fields',
961 'holderClass' => 'pro-field',
962 'alignment' => 'vertical',
963 'multiple' => true,
964 'options' => self::detailAvailableFields(),
965 'default' => array_keys( self::detailAvailableFields() ),
966 'value' => isset( $settings['popup_fields'] ) ? $settings['popup_fields'] : [],
967 ],
968 ];
969 $cf = Fns::is_acf();
970 if ( $cf ) {
971 $plist = self::getCFPluginList();
972 $pName = ! empty( $plist[ $cf ] ) ? $plist[ $cf ] : ' - ';
973 $fields['cf_group'] = [
974 'type' => 'checkbox',
975 'name' => 'cf_group',
976 'holderClass' => 'tpg-hidden cfs-fields cf-group pro-field',
977 'label' => 'Custom Field group ' . " ({$pName})",
978 'multiple' => true,
979 'alignment' => 'vertical',
980 'id' => 'cf_group',
981 'options' => Fns::get_groups_by_post_type( 'all' ),
982 'value' => isset( $settings['cf_group'] ) ? $settings['cf_group'] : [],
983 ];
984 $fields['cf_hide_empty_value'] = [
985 'type' => 'checkbox',
986 'name' => 'cf_hide_empty_value',
987 'holderClass' => 'tpg-hidden cfs-fields pro-field',
988 'label' => esc_html__( 'Hide field with empty value', 'the-post-grid' ),
989 'value' => ! empty( $settings['cf_hide_empty_value'] ) ? 1 : 0,
990 ];
991 $fields['cf_show_only_value'] = [
992 'type' => 'checkbox',
993 'name' => 'cf_show_only_value',
994 'holderClass' => 'tpg-hidden cfs-fields pro-field',
995 'label' => esc_html__( 'Show only value of field', 'the-post-grid' ),
996 'description' => esc_html__( 'By default both name & value of field is shown', 'the-post-grid' ),
997 'value' => ! empty( $settings['cf_show_only_value'] ) ? 1 : 0,
998 ];
999 $fields['cf_hide_group_title'] = [
1000 'type' => 'checkbox',
1001 'name' => 'cf_hide_group_title',
1002 'holderClass' => 'tpg-hidden cfs-fields pro-field',
1003 'label' => esc_html__( 'Hide group title', 'the-post-grid' ),
1004 'value' => ! empty( $settings['cf_hide_group_title'] ) ? 1 : 0,
1005 ];
1006 }
1007
1008 return $fields;
1009 }
1010
1011 public static function detailAvailableFields() {
1012 $fields = self::rtTPGItemFields();
1013 $inserted = [
1014 'content' => esc_html__( 'Content', 'the-post-grid' ),
1015 'feature_img' => esc_html__( 'Feature Image', 'the-post-grid' ),
1016 ];
1017
1018 unset( $fields['heading'] );
1019 unset( $fields['excerpt'] );
1020 unset( $fields['read_more'] );
1021 unset( $fields['comment_count'] );
1022
1023 $offset = array_search( 'title', array_keys( $fields ) ) + 1;
1024 $newFields = array_slice( $fields, 0, $offset, true ) + $inserted + array_slice(
1025 $fields,
1026 $offset,
1027 null,
1028 true
1029 );
1030 $newFields['social_share'] = 'Social Share';
1031
1032 return $newFields;
1033 }
1034
1035 public static function rtTPGSCHeadingSettings() {
1036 $fields = [
1037 'tpg_heading_tag' => [
1038 'type' => 'select',
1039 'name' => 'tpg_heading_tag',
1040 'label' => esc_html__( 'Tag', 'the-post-grid' ),
1041 'class' => 'rt-select2',
1042 'id' => 'heading-tag',
1043 'options' => self::getHeadingTags(),
1044 'default' => 'h2',
1045 ],
1046 'tpg_heading_style' => [
1047 'type' => 'select',
1048 'class' => 'rt-select2',
1049 'label' => esc_html__( 'Style', 'the-post-grid' ),
1050 'blank' => esc_html__( 'Default', 'the-post-grid' ),
1051 'options' => [
1052 'style1' => esc_html__( 'Style 1', 'the-post-grid' ),
1053 'style2' => esc_html__( 'Style 2', 'the-post-grid' ),
1054 'style3' => esc_html__( 'Style 3', 'the-post-grid' ),
1055 ],
1056 ],
1057 'tpg_heading_alignment' => [
1058 'type' => 'select',
1059 'class' => 'rt-select2',
1060 'label' => esc_html__( 'Alignment', 'the-post-grid' ),
1061 'blank' => esc_html__( 'Default', 'the-post-grid' ),
1062 'options' => [
1063 'left' => esc_html__( 'Left', 'the-post-grid' ),
1064 'right' => esc_html__( 'Right', 'the-post-grid' ),
1065 'center' => esc_html__( 'Center', 'the-post-grid' ),
1066 ],
1067 ],
1068 'tpg_heading_link' => [
1069 'type' => 'url',
1070 'label' => esc_html__( 'Link', 'the-post-grid' ),
1071 ],
1072 ];
1073
1074 return $fields;
1075 }
1076
1077 public static function rtTPGSCCategorySettings() {
1078 $fields = [
1079 'tpg_category_position' => [
1080 'type' => 'select',
1081 'class' => 'rt-select2',
1082 'holderClass' => 'pro-field',
1083 'label' => esc_html__( 'Position', 'the-post-grid' ),
1084 'blank' => esc_html__( 'Default', 'the-post-grid' ),
1085 'options' => [
1086 'above_title' => esc_html__( 'Above Title', 'the-post-grid' ),
1087 'top_left' => esc_html__( 'Over image (Top Left)', 'the-post-grid' ),
1088 'top_right' => esc_html__( 'Over image (Top Right)', 'the-post-grid' ),
1089 'bottom_left' => esc_html__( 'Over image (Bottom Left)', 'the-post-grid' ),
1090 'bottom_right' => esc_html__( 'Over image (Bottom Right)', 'the-post-grid' ),
1091 'image_center' => esc_html__( 'Over image (Center)', 'the-post-grid' ),
1092 ],
1093 ],
1094 'tpg_category_style' => [
1095 'type' => 'select',
1096 'class' => 'rt-select2',
1097 'holderClass' => 'pro-field',
1098 'label' => esc_html__( 'Style', 'the-post-grid' ),
1099 'blank' => esc_html__( 'Default', 'the-post-grid' ),
1100 'options' => [
1101 'style1' => esc_html__( 'Style 1', 'the-post-grid' ),
1102 'style2' => esc_html__( 'Style 2', 'the-post-grid' ),
1103 'style3' => esc_html__( 'Style 3', 'the-post-grid' ),
1104 ],
1105 ],
1106 'tpg_category_icon' => [
1107 'type' => 'switch',
1108 'label' => esc_html__( 'Icon', 'the-post-grid' ),
1109 'default' => true,
1110 ],
1111 ];
1112
1113 return $fields;
1114 }
1115
1116 public static function rtTPGSCTitleSettings() {
1117 $fields = [
1118 'tpg_title_position' => [
1119 'type' => 'select',
1120 'label' => esc_html__( 'Title Position (Above or Below image)', 'the-post-grid' ),
1121 'class' => 'rt-select2 ',
1122 'holderClass' => 'pro-field',
1123 'blank' => esc_html__( 'Default', 'the-post-grid' ),
1124 'options' => [
1125 'above' => esc_html__( 'Above image', 'the-post-grid' ),
1126 'below' => esc_html__( 'Below image', 'the-post-grid' ),
1127 ],
1128 'description' => __(
1129 "<span style='color:#ff0000'>Only Layout 1, Layout 12, Layout 14, Isotope1, Isotope8, Isotope10, Carousel Layout 1, Carousel Layout 8, Carousel Layout 10</span>",
1130 'the-post-grid'
1131 ),
1132 ],
1133 'title_tag' => [
1134 'type' => 'select',
1135 'name' => 'title_tag',
1136 'label' => esc_html__( 'Title tag', 'the-post-grid' ),
1137 'class' => 'rt-select2',
1138 'id' => 'title-tag',
1139 'options' => self::getTitleTags(),
1140 'default' => 'h3',
1141 ],
1142 'tpg_title_limit' => [
1143 'type' => 'number',
1144 'label' => esc_html__( 'Title limit', 'the-post-grid' ),
1145 'description' => esc_html__( 'Title limit only integer number is allowed, Leave it blank for full title.', 'the-post-grid' ),
1146 ],
1147 'tpg_title_limit_type' => [
1148 'type' => 'radio',
1149 'label' => esc_html__( 'Title limit type', 'the-post-grid' ),
1150 'alignment' => 'vertical',
1151 'default' => 'character',
1152 'options' => self::get_limit_type(),
1153 ],
1154 ];
1155
1156 return $fields;
1157 }
1158
1159 public static function rtTPGSCMetaSettings() {
1160 $fields = [
1161 'tpg_meta_position' => [
1162 'type' => 'select',
1163 'label' => esc_html__( 'Position', 'the-post-grid' ),
1164 'class' => 'rt-select2 ',
1165 'holderClass' => 'pro-field',
1166 'blank' => esc_html__( 'Default', 'the-post-grid' ),
1167 'options' => [
1168 'above_title' => esc_html__( 'Above Title', 'the-post-grid' ),
1169 'above_excerpt' => esc_html__( 'Above excerpt', 'the-post-grid' ),
1170 'below_excerpt' => esc_html__( 'Below excerpt', 'the-post-grid' ),
1171 ],
1172 ],
1173 'tpg_meta_icon' => [
1174 'type' => 'switch',
1175 'label' => esc_html__( 'Icon', 'the-post-grid' ),
1176 'default' => true,
1177 ],
1178 'tpg_meta_separator' => [
1179 'type' => 'select',
1180 'class' => 'rt-select2',
1181 'label' => esc_html__( 'Separator', 'the-post-grid' ),
1182 'blank' => esc_html__( 'Default', 'the-post-grid' ),
1183 'options' => [
1184 'dot' => esc_html__( 'Dot ( . )', 'the-post-grid' ),
1185 's_slash' => esc_html__( 'Single Slash ( / )', 'the-post-grid' ),
1186 'd_slash' => esc_html__( 'Double Slash ( // )', 'the-post-grid' ),
1187 'hypen' => esc_html__( 'Hypen ( - )', 'the-post-grid' ),
1188 'v_pipe' => esc_html__( 'Vertical Pipe ( | )', 'the-post-grid' ),
1189 ],
1190 ],
1191 ];
1192
1193 return $fields;
1194 }
1195
1196 public static function rtTPGSCImageSettings() {
1197 $fields = [
1198 'feature_image' => [
1199 'type' => 'switch',
1200 'label' => esc_html__( 'Hide Feature Image', 'the-post-grid' ),
1201 'id' => 'rt-tpg-feature-image',
1202 'default' => false,
1203 ],
1204 'featured_image_size' => [
1205 'type' => 'select',
1206 'label' => esc_html__( 'Feature Image Size', 'the-post-grid' ),
1207 'class' => 'rt-select2',
1208 'holderClass' => 'rt-feature-image-option tpg-hidden',
1209 'options' => Fns::get_image_sizes(),
1210 ],
1211 'custom_image_size' => [
1212 'type' => 'image_size',
1213 'label' => esc_html__( 'Custom Image Size', 'the-post-grid' ),
1214 'holderClass' => 'rt-sc-custom-image-size-holder tpg-hidden',
1215 'multiple' => true,
1216 ],
1217 'media_source' => [
1218 'type' => 'radio',
1219 'label' => esc_html__( 'Media Source', 'the-post-grid' ),
1220 'default' => 'feature_image',
1221 'alignment' => 'vertical',
1222 'holderClass' => 'rt-feature-image-option tpg-hidden',
1223 'options' => self::rtMediaSource(),
1224 ],
1225 'tgp_layout2_image_column' => [
1226 'type' => 'select',
1227 'label' => esc_html__( 'Image column', 'the-post-grid' ),
1228 'class' => 'rt-select2',
1229 'holderClass' => 'holder-layout2-image-column tpg-hidden',
1230 'default' => 4,
1231 'options' => self::scColumns(),
1232 'description' => 'Content column will calculate automatically',
1233 ],
1234 'tpg_image_type' => [
1235 'type' => 'radio',
1236 'label' => esc_html__( 'Type', 'the-post-grid' ),
1237 'alignment' => 'vertical',
1238 'holderClass' => 'rt-feature-image-option tpg-hidden pro-field',
1239 'default' => 'normal',
1240 'options' => self::get_image_types(),
1241 ],
1242 'tpg_image_animation' => [
1243 'type' => 'select',
1244 'label' => esc_html__( 'Hover Animation', 'the-post-grid' ),
1245 'class' => 'rt-select2',
1246 'blank' => esc_html__( 'Default', 'the-post-grid' ),
1247 'options' => [
1248 'img_zoom_in' => esc_html__( 'Zoom in', 'the-post-grid' ),
1249 'img_zoom_out' => esc_html__( 'Zoom out', 'the-post-grid' ),
1250 'img_no_effect' => esc_html__( 'None', 'the-post-grid' ),
1251 ],
1252 ],
1253 'tpg_image_border_radius' => [
1254 'type' => 'number',
1255 'class' => 'small-text',
1256 'holderClass' => 'pro-field',
1257 'label' => esc_html__( 'Border radius', 'the-post-grid' ),
1258 'description' => esc_html__( 'Leave it blank for default', 'the-post-grid' ),
1259 ],
1260 ];
1261
1262 return apply_filters( 'rt_tpg_sc_image_settings', $fields );
1263 }
1264
1265 public static function rtTPGSCExcerptSettings() {
1266 $fields = [
1267 'excerpt_limit' => [
1268 'type' => 'number',
1269 'label' => esc_html__( 'Excerpt limit', 'the-post-grid' ),
1270 'default' => 15,
1271 'description' => esc_html__( 'Excerpt limit only integer number is allowed, Leave it blank for full excerpt.', 'the-post-grid' ),
1272 ],
1273 'tgp_excerpt_type' => [
1274 'type' => 'radio',
1275 'label' => esc_html__( 'Excerpt Type', 'the-post-grid' ),
1276 'alignment' => 'vertical',
1277 'default' => 'word',
1278 'options' => self::get_limit_type( 'content' ),
1279 ],
1280 'tgp_excerpt_more_text' => [
1281 'type' => 'text',
1282 'label' => esc_html__( 'Excerpt more text', 'the-post-grid' ),
1283 'default' => '...',
1284 ],
1285 ];
1286
1287 return $fields;
1288 }
1289
1290 public static function rtTPGSCButtonSettings() {
1291 $fields = [
1292 'tpg_read_more_button_border_radius' => [
1293 'type' => 'number',
1294 'class' => 'small-text',
1295 'label' => esc_html__( 'Border radius', 'the-post-grid' ),
1296 'description' => esc_html__( 'Leave it blank for default', 'the-post-grid' ),
1297 ],
1298 'tpg_read_more_button_alignment' => [
1299 'type' => 'select',
1300 'class' => 'rt-select2',
1301 'label' => esc_html__( 'Alignment', 'the-post-grid' ),
1302 'blank' => esc_html__( 'Default', 'the-post-grid' ),
1303 'options' => [
1304 'left' => esc_html__( 'Left', 'the-post-grid' ),
1305 'right' => esc_html__( 'Right', 'the-post-grid' ),
1306 'center' => esc_html__( 'Center', 'the-post-grid' ),
1307 ],
1308 ],
1309 'tgp_read_more_text' => [
1310 'type' => 'text',
1311 'label' => esc_html__( 'Text', 'the-post-grid' ),
1312 ],
1313 ];
1314
1315 return $fields;
1316 }
1317
1318 public static function rtTPGStyleFields() {
1319 $fields = [
1320 'parent_class' => [
1321 'type' => 'text',
1322 'label' => esc_html__( 'Parent class', 'the-post-grid' ),
1323 'class' => 'medium-text',
1324 'description' => esc_html__( 'Parent class for adding custom css', 'the-post-grid' ),
1325 ],
1326 'primary_color' => [
1327 'type' => 'text',
1328 'label' => esc_html__( 'Primary Color', 'the-post-grid' ),
1329 'class' => 'rt-color',
1330 'default' => '#0367bf',
1331 ],
1332 ];
1333
1334 return apply_filters( 'rt_tpg_style_fields', $fields );
1335 }
1336
1337 public static function rtTPGStyleButtonColorFields() {
1338 $fields = [
1339
1340 'button_bg_color' => [
1341 'type' => 'text',
1342 'name' => 'button_bg_color',
1343 'label' => esc_html__( 'Background', 'the-post-grid' ),
1344 'class' => 'rt-color',
1345 ],
1346 'button_hover_bg_color' => [
1347 'type' => 'text',
1348 'name' => 'button_hover_bg_color',
1349 'label' => esc_html__( 'Hover Background', 'the-post-grid' ),
1350 'class' => 'rt-color',
1351 ],
1352 'button_active_bg_color' => [
1353 'type' => 'text',
1354 'label' => esc_html__( 'Active Background (Isotop)', 'the-post-grid' ),
1355 'class' => 'rt-color',
1356 ],
1357 'button_text_bg_color' => [
1358 'type' => 'text',
1359 'label' => esc_html__( 'Text', 'the-post-grid' ),
1360 'class' => 'rt-color',
1361 ],
1362 'button_hover_text_color' => [
1363 'type' => 'text',
1364 'label' => esc_html__( 'Text Hover', 'the-post-grid' ),
1365 'class' => 'rt-color',
1366 ],
1367 ];
1368
1369 return apply_filters( 'rt_tpg_style_button_css_fields', $fields );
1370 }
1371
1372 public static function rtTPGStyleHeading() {
1373 $fields = [
1374 'tpg_heading_bg' => [
1375 'type' => 'text',
1376 'class' => 'rt-color',
1377 'label' => esc_html__( 'Background Color', 'the-post-grid' ),
1378 ],
1379 'tpg_heading_color' => [
1380 'type' => 'text',
1381 'class' => 'rt-color',
1382 'label' => esc_html__( 'Text Color', 'the-post-grid' ),
1383 ],
1384 'tpg_heading_border_color' => [
1385 'type' => 'text',
1386 'class' => 'rt-color',
1387 'label' => esc_html__( 'Border Color', 'the-post-grid' ),
1388 ],
1389 'tpg_heading_border_size' => [
1390 'type' => 'number',
1391 'class' => 'small-text',
1392 'label' => esc_html__( 'Border Size', 'the-post-grid' ),
1393 'description' => esc_html__( 'Leave it blank for default', 'the-post-grid' ),
1394 ],
1395 'tpg_heading_margin' => [
1396 'type' => 'text',
1397 'class' => 'medium-text tpg-spacing-field',
1398 'label' => esc_html__( 'Margin', 'the-post-grid' ),
1399 'description' => esc_html__( 'Multiple value allowed separated by comma 12,0,5,10', 'the-post-grid' ),
1400 ],
1401 'tpg_heading_padding' => [
1402 'type' => 'text',
1403 'class' => 'medium-text tpg-spacing-field',
1404 'label' => esc_html__( 'Padding', 'the-post-grid' ),
1405 'description' => esc_html__( 'Leave it blank for default, multiple value allowed separated by comma 12,0,5,10', 'the-post-grid' ),
1406 ],
1407 ];
1408
1409 return apply_filters( 'tpg_heading_style_fields', $fields );
1410 }
1411
1412 public static function rtTPGStyleFullArea() {
1413 $fields = [
1414 'tpg_full_area_bg' => [
1415 'type' => 'text',
1416 'class' => 'rt-color',
1417 'label' => esc_html__( 'Background', 'the-post-grid' ),
1418 ],
1419 'tpg_full_area_margin' => [
1420 'type' => 'text',
1421 'class' => 'medium-text',
1422 'label' => esc_html__( 'Margin', 'the-post-grid' ),
1423 'description' => esc_html__( 'Multiple value allowed separated by comma 12,0,5,10', 'the-post-grid' ),
1424 ],
1425 'tpg_full_area_padding' => [
1426 'type' => 'text',
1427 'class' => 'medium-text',
1428 'label' => esc_html__( 'Padding', 'the-post-grid' ),
1429 'description' => esc_html__( 'Multiple value allowed separated by comma 12,0,5,10', 'the-post-grid' ),
1430 ],
1431 ];
1432
1433 return apply_filters( 'tpg_box_style_fields', $fields );
1434 }
1435
1436 public static function rtTPGStyleContentWrap() {
1437 $fields = [
1438 'tpg_content_wrap_bg' => [
1439 'type' => 'text',
1440 'class' => 'rt-color',
1441 'label' => esc_html__( 'Background Color', 'the-post-grid' ),
1442 ],
1443 'tpg_content_wrap_shadow' => [
1444 'type' => 'text',
1445 'class' => 'rt-color',
1446 'label' => esc_html__( 'Box Shadow Color', 'the-post-grid' ),
1447 ],
1448 'tpg_content_wrap_border_color' => [
1449 'type' => 'text',
1450 'class' => 'rt-color',
1451 'label' => esc_html__( 'Border Color', 'the-post-grid' ),
1452 ],
1453 'tpg_content_wrap_border' => [
1454 'type' => 'number',
1455 'class' => 'small-text',
1456 'label' => esc_html__( 'Border Width', 'the-post-grid' ),
1457 'description' => esc_html__( 'Leave it blank for default', 'the-post-grid' ),
1458 ],
1459 'tpg_content_wrap_border_radius' => [
1460 'type' => 'number',
1461 'class' => 'small-text',
1462 'label' => esc_html__( 'Border Radius', 'the-post-grid' ),
1463 ],
1464 'tpg_box_padding' => [
1465 'type' => 'text',
1466 'class' => 'medium-text',
1467 'label' => esc_html__( 'Box Padding', 'the-post-grid' ),
1468 'description' => esc_html__( 'Multiple value allowed separated by comma 12,0,5,10', 'the-post-grid' ),
1469 ],
1470 'tpg_content_padding' => [
1471 'type' => 'text',
1472 'class' => 'medium-text',
1473 'label' => esc_html__( 'Content Padding', 'the-post-grid' ),
1474 'description' => esc_html__( 'Multiple value allowed separated by comma 12,0,5,10', 'the-post-grid' ),
1475 ],
1476 ];
1477
1478 return apply_filters( 'tpg_content_style_fields', $fields );
1479 }
1480
1481 public static function rtTPGStyleCategory() {
1482 $fields = [
1483 'tpg_category_bg' => [
1484 'type' => 'text',
1485 'class' => 'rt-color',
1486 'label' => esc_html__( 'Background Color', 'the-post-grid' ),
1487 ],
1488 'tpg_category_color' => [
1489 'type' => 'text',
1490 'class' => 'rt-color',
1491 'label' => esc_html__( 'Text Color', 'the-post-grid' ),
1492 ],
1493 'tpg_category_border_radius' => [
1494 'type' => 'number',
1495 'class' => 'small-text',
1496 'label' => esc_html__( 'Border Radius', 'the-post-grid' ),
1497 'description' => esc_html__( 'Leave it blank for default', 'the-post-grid' ),
1498 ],
1499 'tpg_category_margin' => [
1500 'type' => 'text',
1501 'class' => 'medium-text tpg-spacing-field',
1502 'label' => esc_html__( 'Margin', 'the-post-grid' ),
1503 'description' => esc_html__( 'Multiple value allowed separated by comma 12,0,5,10', 'the-post-grid' ),
1504 ],
1505 'tpg_category_padding' => [
1506 'type' => 'text',
1507 'class' => 'medium-text tpg-spacing-field',
1508 'label' => esc_html__( 'Padding', 'the-post-grid' ),
1509 'description' => esc_html__( 'Multiple value allowed separated by comma 12,0,5,10', 'the-post-grid' ),
1510 ],
1511 'rt_tpg_category_font_size' => [
1512 'type' => 'select',
1513 'class' => 'rt-select2',
1514 'label' => esc_html__( 'Font Size', 'the-post-grid' ),
1515 'blank' => esc_html__( 'Default', 'the-post-grid' ),
1516 'options' => self::scFontSize(),
1517 ],
1518 ];
1519
1520 return apply_filters( 'tpg_category_style_fields', $fields );
1521 }
1522
1523
1524 public static function itemFields() {
1525
1526 $itemField = self::rtTPGItemFields();
1527 $itemField['tpg_default_value'] = 'Default';
1528
1529 $fields = [
1530 'item_fields' => [
1531 'type' => 'checkbox',
1532 'name' => 'item_fields',
1533 'label' => esc_html__( 'Field selection', 'the-post-grid' ),
1534 'id' => 'item-fields',
1535 'multiple' => true,
1536 'alignment' => 'vertical',
1537 'default' => array_keys( $itemField ),
1538 'options' => $itemField,
1539 ],
1540 ];
1541 if ( $cf = Fns::is_acf() ) {
1542 global $post;
1543 $post_type = get_post_meta( $post->ID, 'tpg_post_type', true );
1544 $plist = self::getCFPluginList();
1545 $fields['cf_group'] = [
1546 'type' => 'checkbox',
1547 'name' => 'cf_group',
1548 'holderClass' => 'tpg-hidden cf-fields cf-group',
1549 'label' => 'Custom Field group ' . " ({$plist[$cf]})",
1550 'multiple' => true,
1551 'alignment' => 'vertical',
1552 'id' => 'cf_group',
1553 'options' => Fns::get_groups_by_post_type( $post_type, $cf ),
1554 ];
1555 $fields['cf_hide_empty_value'] = [
1556 'type' => 'checkbox',
1557 'name' => 'cf_hide_empty_value',
1558 'holderClass' => 'tpg-hidden cf-fields',
1559 'label' => esc_html__( 'Hide field with empty value', 'the-post-grid' ),
1560 'default' => 1,
1561 ];
1562 $fields['cf_show_only_value'] = [
1563 'type' => 'checkbox',
1564 'name' => 'cf_show_only_value',
1565 'holderClass' => 'tpg-hidden cf-fields',
1566 'label' => esc_html__( 'Show only value of field', 'the-post-grid' ),
1567 'description' => esc_html__( 'By default both name & value of field is shown', 'the-post-grid' ),
1568 ];
1569 $fields['cf_hide_group_title'] = [
1570 'type' => 'checkbox',
1571 'name' => 'cf_hide_group_title',
1572 'holderClass' => 'tpg-hidden cf-fields',
1573 'label' => esc_html__( 'Hide group title', 'the-post-grid' ),
1574 ];
1575 }
1576
1577 return $fields;
1578 }
1579
1580
1581 public static function getCFPluginList() {
1582 return [
1583 'acf' => esc_html__( 'Advanced Custom Field', 'the-post-grid' ),
1584 ];
1585 }
1586
1587 public static function rtMediaSource() {
1588 return [
1589 'feature_image' => esc_html__( 'Feature Image', 'the-post-grid' ),
1590 'first_image' => esc_html__( 'First Image from content', 'the-post-grid' ),
1591 ];
1592 }
1593
1594 public static function get_image_types() {
1595 return [
1596 'normal' => esc_html__( 'Normal', 'the-post-grid' ),
1597 'circle' => esc_html__( 'Circle', 'the-post-grid' ),
1598 ];
1599 }
1600
1601 public static function get_limit_type( $content = null ) {
1602 $types = [
1603 'character' => esc_html__( 'Character', 'the-post-grid' ),
1604 'word' => esc_html__( 'Word', 'the-post-grid' ),
1605 ];
1606 if ( $content === 'content' ) {
1607 $types['full'] = esc_html__( 'Full Content', 'the-post-grid' );
1608 }
1609
1610 return apply_filters( 'tpg_limit_type', $types, $content );
1611 }
1612
1613 public static function scColumns() {
1614 return [
1615 1 => esc_html__( 'Column 1', 'the-post-grid' ),
1616 2 => esc_html__( 'Column 2', 'the-post-grid' ),
1617 3 => esc_html__( 'Column 3', 'the-post-grid' ),
1618 4 => esc_html__( 'Column 4', 'the-post-grid' ),
1619 5 => esc_html__( 'Column 5', 'the-post-grid' ),
1620 6 => esc_html__( 'Column 6', 'the-post-grid' ),
1621 ];
1622 }
1623
1624 public static function tgp_filter_list() {
1625 return [
1626 '_taxonomy_filter' => esc_html__( 'Taxonomy filter', 'the-post-grid' ),
1627 '_author_filter' => esc_html__( 'Author filter', 'the-post-grid' ),
1628 '_order_by' => esc_html__( 'Order - Sort retrieved posts by parameter', 'the-post-grid' ),
1629 '_sort_order' => esc_html__( 'Sort Order - Designates the ascending or descending order of the "orderby" parameter', 'the-post-grid' ),
1630 '_search' => esc_html__( 'Search filter', 'the-post-grid' ),
1631 ];
1632 }
1633
1634 public static function overflowOpacity() {
1635 return [
1636 1 => esc_html__( '10%', 'the-post-grid' ),
1637 2 => esc_html__( '20%', 'the-post-grid' ),
1638 3 => esc_html__( '30%', 'the-post-grid' ),
1639 4 => esc_html__( '40%', 'the-post-grid' ),
1640 5 => esc_html__( '50%', 'the-post-grid' ),
1641 6 => esc_html__( '60%', 'the-post-grid' ),
1642 7 => esc_html__( '70%', 'the-post-grid' ),
1643 8 => esc_html__( '80%', 'the-post-grid' ),
1644 9 => esc_html__( '90%', 'the-post-grid' ),
1645 ];
1646 }
1647
1648 public static function rtTPGLayoutType() {
1649 $layoutType = [
1650 'grid' => [
1651 'title' => esc_html__( 'Grid', 'the-post-grid' ),
1652 'img' => rtTPG()->get_assets_uri( 'images/grid.png' ),
1653 ],
1654 'grid_hover' => [
1655 'title' => esc_html__( 'Grid Hover', 'the-post-grid' ),
1656 'img' => rtTPG()->get_assets_uri( 'images/grid_hover.png' ),
1657 ],
1658 'list' => [
1659 'title' => esc_html__( 'List', 'the-post-grid' ),
1660 'img' => rtTPG()->get_assets_uri( 'images/list.png' ),
1661 ],
1662 'isotope' => [
1663 'title' => esc_html__( 'Isotope', 'the-post-grid' ),
1664 'img' => rtTPG()->get_assets_uri( 'images/isotope.png' ),
1665 ],
1666 ];
1667
1668 return apply_filters( 'rt_tpg_layouts_type', $layoutType );
1669 }
1670
1671 public static function rtTPGLayouts() {
1672 $layouts = [
1673 'layout1' => [
1674 'title' => esc_html__( 'Grid Layout 1', 'the-post-grid' ),
1675 'layout' => 'grid',
1676 'layout_link' => 'https://www.radiustheme.com/demo/plugins/the-post-grid/',
1677 'img' => rtTPG()->get_assets_uri( 'images/layouts/grid1.png' ),
1678 ],
1679 'layout12' => [
1680 'title' => esc_html__( 'Grid Layout 2', 'the-post-grid' ),
1681 'layout' => 'grid',
1682 'layout_link' => 'https://www.radiustheme.com/demo/plugins/the-post-grid/grid-layout-2/',
1683 'img' => rtTPG()->get_assets_uri( 'images/layouts/grid10.png' ),
1684 ],
1685 'layout5' => [
1686 'title' => esc_html__( 'Grid Hover 1', 'the-post-grid' ),
1687 'layout' => 'grid_hover',
1688 'layout_link' => 'https://www.radiustheme.com/demo/plugins/the-post-grid/hover-layout-1/',
1689 'img' => rtTPG()->get_assets_uri( 'images/layouts/grid3.png' ),
1690 ],
1691 'layout6' => [
1692 'title' => esc_html__( 'Grid Hover 2', 'the-post-grid' ),
1693 'layout' => 'grid_hover',
1694 'layout_link' => 'https://www.radiustheme.com/demo/plugins/the-post-grid/hover-layout-2/',
1695 'img' => rtTPG()->get_assets_uri( 'images/layouts/grid4.png' ),
1696 ],
1697 'layout7' => [
1698 'title' => esc_html__( 'Grid Hover 3', 'the-post-grid' ),
1699 'layout' => 'grid_hover',
1700 'layout_link' => 'https://www.radiustheme.com/demo/plugins/the-post-grid/hover-layout-3/',
1701 'img' => rtTPG()->get_assets_uri( 'images/layouts/grid5.png' ),
1702 ],
1703 'layout2' => [
1704 'title' => esc_html__( 'List Layout 1', 'the-post-grid' ),
1705 'layout' => 'list',
1706 'layout_link' => 'https://www.radiustheme.com/demo/plugins/the-post-grid/list-layout-1/',
1707 'img' => rtTPG()->get_assets_uri( 'images/layouts/list1.png' ),
1708 ],
1709 'layout3' => [
1710 'title' => esc_html__( 'List Layout 2', 'the-post-grid' ),
1711 'layout' => 'list',
1712 'layout_link' => 'https://www.radiustheme.com/demo/plugins/the-post-grid/list-layout-rounded-image/',
1713 'img' => rtTPG()->get_assets_uri( 'images/layouts/list2.png' ),
1714 ],
1715 'isotope1' => [
1716 'title' => esc_html__( 'Isotope Layout 1', 'the-post-grid' ),
1717 'layout' => 'isotope',
1718 'layout_link' => 'https://www.radiustheme.com/demo/plugins/the-post-grid/layout-4-filter/',
1719 'img' => rtTPG()->get_assets_uri( 'images/layouts/isotope1.png' ),
1720 ],
1721 ];
1722
1723 return apply_filters( 'tpg_layouts', $layouts );
1724 }
1725
1726 public static function rtTPGItemFields() {
1727 $items = [
1728 'heading' => esc_html__( 'ShortCode Heading', 'the-post-grid' ),
1729 'title' => esc_html__( 'Title', 'the-post-grid' ),
1730 'excerpt' => esc_html__( 'Excerpt', 'the-post-grid' ),
1731 'read_more' => esc_html__( 'Read More', 'the-post-grid' ),
1732 'post_date' => esc_html__( 'Post Date', 'the-post-grid' ),
1733 'author' => esc_html__( 'Author', 'the-post-grid' ),
1734 'categories' => esc_html__( 'Categories', 'the-post-grid' ),
1735 'tags' => esc_html__( 'Tags', 'the-post-grid' ),
1736 'comment_count' => esc_html__( 'Comment count', 'the-post-grid' ),
1737 ];
1738
1739 return apply_filters( 'tpg_field_selection_items', $items );
1740 }
1741
1742 public static function postLoadingType() {
1743 return apply_filters(
1744 'rttpg_pagination_type',
1745 [
1746 'pagination' => esc_html__( 'Pagination', 'the-post-grid' ),
1747 ]
1748 );
1749 }
1750
1751 public static function scGridOpt() {
1752 return [
1753 'even' => esc_html__( 'Even', 'the-post-grid' ),
1754 'masonry' => esc_html__( 'Masonry', 'the-post-grid' ),
1755 ];
1756 }
1757
1758 public static function extraStyle() {
1759 return apply_filters(
1760 'tpg_extra_style',
1761 [
1762 'title' => esc_html__( 'Title', 'the-post-grid' ),
1763 'title_hover' => esc_html__( 'Title hover', 'the-post-grid' ),
1764 'excerpt' => esc_html__( 'Excerpt', 'the-post-grid' ),
1765 'meta_data' => esc_html__( 'Meta Data', 'the-post-grid' ),
1766 ]
1767 );
1768 }
1769
1770 public static function scFontSize() {
1771 $num = [];
1772 for ( $i = 10; $i <= 50; $i++ ) {
1773 $num[ $i ] = $i . 'px';
1774 }
1775
1776 return $num;
1777 }
1778
1779 public static function scAlignment() {
1780 return [
1781 'left' => esc_html__( 'Left', 'the-post-grid' ),
1782 'right' => esc_html__( 'Right', 'the-post-grid' ),
1783 'center' => esc_html__( 'Center', 'the-post-grid' ),
1784 'justify' => esc_html__( 'Justify', 'the-post-grid' ),
1785 ];
1786 }
1787
1788 public static function scReadMoreButtonPositionList() {
1789 return [
1790 'left' => esc_html__( 'Left', 'the-post-grid' ),
1791 'right' => esc_html__( 'Right', 'the-post-grid' ),
1792 'center' => esc_html__( 'Center', 'the-post-grid' ),
1793 ];
1794 }
1795
1796
1797 public static function scTextWeight() {
1798 return [
1799 'normal' => esc_html__( 'Normal', 'the-post-grid' ),
1800 'bold' => esc_html__( 'Bold', 'the-post-grid' ),
1801 'bolder' => esc_html__( 'Bolder', 'the-post-grid' ),
1802 'lighter' => esc_html__( 'Lighter', 'the-post-grid' ),
1803 'inherit' => esc_html__( 'Inherit', 'the-post-grid' ),
1804 'initial' => esc_html__( 'Initial', 'the-post-grid' ),
1805 'unset' => esc_html__( 'Unset', 'the-post-grid' ),
1806 100 => esc_html__( '100', 'the-post-grid' ),
1807 200 => esc_html__( '200', 'the-post-grid' ),
1808 300 => esc_html__( '300', 'the-post-grid' ),
1809 400 => esc_html__( '400', 'the-post-grid' ),
1810 500 => esc_html__( '500', 'the-post-grid' ),
1811 600 => esc_html__( '600', 'the-post-grid' ),
1812 700 => esc_html__( '700', 'the-post-grid' ),
1813 800 => esc_html__( '800', 'the-post-grid' ),
1814 900 => esc_html__( '900', 'the-post-grid' ),
1815 ];
1816 }
1817
1818 public static function imageCropType() {
1819 return [
1820 'soft' => esc_html__( 'Soft Crop', 'the-post-grid' ),
1821 'hard' => esc_html__( 'Hard Crop', 'the-post-grid' ),
1822 ];
1823 }
1824
1825 public static function rt_filter_type() {
1826 return [
1827 'dropdown' => esc_html__( 'Dropdown', 'the-post-grid' ),
1828 'button' => esc_html__( 'Button', 'the-post-grid' ),
1829 ];
1830 }
1831
1832 public static function get_pro_feature_list() {
1833 return '<ol>
1834 <li>Fully responsive and mobile friendly.</li>
1835 <li>62 Different Layouts</li>
1836 <li>45 Elementor Layouts</li>
1837 <li>Creative Slider layouts</li>
1838 <li>Archive page builder for Elementor</li>
1839 <li>Even and Masonry Grid.</li>
1840 <li>WooCommerce supported.</li>
1841 <li>EDD supported for shortcode.</li>
1842 <li>Custom Post Type Supported</li>
1843 <li>Display posts by any Taxonomy like category(s), tag(s), author(s), keyword(s)</li>
1844 <li>Order by Id, Title, Created date, Modified date and Menu order.</li>
1845 <li>Display image size (thumbnail, medium, large, full)</li>
1846 <li>Ajax front-end filter by category(s), tag(s), author(s), keyword(s)</li>
1847 <li>Isotope filter for any taxonomy ie. categories, tags...</li>
1848 <li>Query Post with Relation.</li>
1849 <li>Fields Selection.</li>
1850 <li>All Text and Color control.</li>
1851 <li>Meta Position Control.</li>
1852 <li>Category Position Control.</li>
1853 <li>Content Wrapper Style Control.</li>
1854 <li>Enable/Disable Pagination.</li>
1855 <li>AJAX Pagination (Load more and Load on Scrolling)</li>
1856 <li>Advanced Custom Field support</li>
1857 <li>Post View Count</li>
1858 </ol>
1859 <a href="' . esc_url( rtTpg()->proLink() ) . '" class="rt-admin-btn" target="_blank">' . esc_html__( 'Get Pro Version', 'the-post-grid' ) . '</a>';
1860 }
1861 }
1862