PluginProbe
Ever Compare – Products Compare Plugin for WooCommerce / trunk
Ever Compare – Products Compare Plugin for WooCommerce vtrunk
1.3.7 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 trunk 1.0.0 1.0.1 1.0.2 All 31 releases
ever-compare / includes / classes / Admin / Admin_Fields.php

Admin_Fields.php in Ever Compare – Products Compare Plugin for WooCommerce trunk, at includes/classes/Admin/Admin_Fields.php

769 lines 36.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace EverCompare\Admin;
3
4 defined( 'ABSPATH' ) || exit;
5 /**
6 * Admin Page Fields handlers class
7 */
8 class Admin_Fields {
9
10 private $settings_api;
11
12 /**
13 * [$_instance]
14 * @var null
15 */
16 private static $_instance = null;
17
18 /**
19 * [instance] Initializes a singleton instance
20 * @return [Admin]
21 */
22 public static function instance() {
23 if ( is_null( self::$_instance ) ) {
24 self::$_instance = new self();
25 }
26 return self::$_instance;
27 }
28
29 function __construct() {
30 $this->settings_api = new Settings_APi();
31 add_action( 'admin_init', [ $this, 'admin_init' ] );
32 }
33
34 public function admin_init() {
35
36 //set the settings
37 $this->settings_api->set_sections( $this->get_settings_sections() );
38 $this->settings_api->set_fields( $this->fields_settings() );
39
40 //initialize settings
41 $this->settings_api->admin_init();
42 }
43
44 // Options page Section register
45 public function get_settings_sections() {
46 $sections = array(
47
48 array(
49 'id' => 'ever_compare_settings_general',
50 'title' => esc_html__( 'General Settings', 'ever-compare' ),
51 ),
52
53 array(
54 'id' => 'ever_compare_settings_tabs',
55 'title' => esc_html__( 'Button Settings', 'ever-compare' ),
56 ),
57
58 array(
59 'id' => 'ever_compare_table_settings_tabs',
60 'title' => esc_html__( 'Table Settings', 'ever-compare' )
61 ),
62 array(
63 'id' => 'ever_compare_style_tabs',
64 'title' => esc_html__( 'Style Settings', 'ever-compare' ),
65 )
66
67 );
68 return $sections;
69 }
70
71 // Options page field register
72 protected function fields_settings() {
73
74 $settings_fields = array(
75
76 'ever_compare_settings_general' => array(
77
78 array(
79 'name' => 'enable_success_notification',
80 'label' => __( 'Show successful notification', 'ever-compare' ),
81 'type' => 'checkbox',
82 'default' => 'off',
83 'desc' => esc_html__( 'Enable this option to display a notification when a client adds or removes a product from the compare.', 'ever-compare' ),
84 ),
85
86 array(
87 'name' => 'success_added_notification_text',
88 'label' => __( '"Product added to compare" Text', 'ever-compare' ),
89 'type' => 'text',
90 'default' => __( '{product_name} added to compare.', 'ever-compare'),
91 'desc' => esc_html__( 'You can use the placeholder {product_name} to get the current product name.', 'ever-compare' ),
92 'class' => 'depend_enable_success_notification'
93 ),
94 array(
95 'name' => 'success_removed_notification_text',
96 'label' => __( '"Product removed from compare" Text', 'ever-compare' ),
97 'type' => 'text',
98 'default' => __( '{product_name} removed from compare.', 'ever-compare'),
99 'desc' => esc_html__( 'You can use the placeholder {product_name} to get the current product name.', 'ever-compare' ),
100 'class' => 'depend_enable_success_notification'
101 ),
102 array(
103 'name' => 'removed_notification_after',
104 'label' => __( 'Remove Notification automatically after (seconds)', 'ever-compare' ),
105 'type' => 'number',
106 'default' => 4,
107 'min' => -1,
108 'desc' => esc_html__( 'If you wish to always display the notification, please input the value "-1".', 'ever-compare' ),
109 'class' => 'depend_enable_success_notification'
110 ),
111 ),
112
113 'ever_compare_settings_tabs' => array(
114
115 array(
116 'name' => 'btn_show_shoppage',
117 'label' => __( 'Show button in product list page', 'ever-compare' ),
118 'desc' => __( 'Show compare button in product list page.', 'ever-compare' ),
119 'type' => 'checkbox',
120 'default' => 'off',
121 ),
122
123 array(
124 'name' => 'btn_show_productpage',
125 'label' => __( 'Show button in single product page', 'ever-compare' ),
126 'desc' => __( 'Show compare button in single product page.', 'ever-compare' ),
127 'type' => 'checkbox',
128 'default' => 'on',
129 ),
130
131 array(
132 'name' => 'remove_on_click',
133 'label' => __( 'Remove product from compare on second click', 'ever-compare' ),
134 'type' => 'checkbox',
135 'default' => 'off',
136 'desc' => __( 'Remove the product from the compare if it has already been added.', 'ever-compare' ),
137 ),
138
139 array(
140 'name' => 'shop_btn_position',
141 'label' => __( 'Shop page button position', 'ever-compare' ),
142 'desc' => __( 'You can manage compare button position in product list page.', 'ever-compare' ),
143 'type' => 'select',
144 'default' => 'after_cart_btn',
145 'options' => [
146 'before_cart_btn' => __( 'Before Add To Cart', 'ever-compare' ),
147 'after_cart_btn' => __( 'After Add To Cart', 'ever-compare' ),
148 'top_thumbnail' => __( 'Top On Image', 'ever-compare' ),
149 'use_shortcode' => __( 'Use Shortcode', 'ever-compare' ),
150 'custom_position' => __( 'Custom Position', 'ever-compare' ),
151 ],
152 ),
153
154 array(
155 'name' => 'shop_use_shortcode_message',
156 'headding'=> wp_kses_post('<code>[evercompare_button]</code> Use this shortcode into your theme/child theme to place the compare button.'),
157 'type' => 'title',
158 'size' => 'margin_0 regular',
159 'class' => 'depend_shop_btn_position_use_shortcode element_section_title_area message-info',
160 ),
161
162 array(
163 'name' => 'shop_custom_hook_message',
164 'headding'=> esc_html__( 'Some themes remove the above positions. In that case, custom position is useful. Here you can place the custom/default hook name & priority to inject & adjust the compare button for the product loop.', 'ever-compare' ),
165 'type' => 'title',
166 'size' => 'margin_0 regular',
167 'class' => 'depend_shop_btn_position_custom_hook element_section_title_area message-info',
168 ),
169
170 array(
171 'name' => 'shop_custom_hook_name',
172 'label' => __( 'Hook name', 'ever-compare' ),
173 'desc' => __( 'e.g: woocommerce_after_shop_loop_item_title', 'ever-compare' ),
174 'type' => 'text',
175 'class' => 'depend_shop_btn_position_custom_hook'
176 ),
177
178 array(
179 'name' => 'shop_custom_hook_priority',
180 'label' => __( 'Hook priority', 'ever-compare' ),
181 'desc' => __( 'Default: 10', 'ever-compare' ),
182 'type' => 'text',
183 'class' => 'depend_shop_btn_position_custom_hook'
184 ),
185
186 array(
187 'name' => 'product_btn_position',
188 'label' => __( 'Product page button position', 'ever-compare' ),
189 'desc' => __( 'You can manage compare button position in single product page.', 'ever-compare' ),
190 'type' => 'select',
191 'default' => 'after_cart_btn',
192 'options' => [
193 'before_cart_btn' => __( 'Before Add To Cart', 'ever-compare' ),
194 'after_cart_btn' => __( 'After Add To Cart', 'ever-compare' ),
195 'after_thumbnail' => __( 'After Image', 'ever-compare' ),
196 'after_summary' => __( 'After Summary', 'ever-compare' ),
197 'use_shortcode' => __( 'Use Shortcode', 'ever-compare' ),
198 'custom_position' => __( 'Custom Position', 'ever-compare' ),
199 ],
200 ),
201
202 array(
203 'name' => 'product_use_shortcode_message',
204 'headding'=> wp_kses_post('<code>[evercompare_button]</code> Use this shortcode into your theme/child theme to place the compare button.'),
205 'type' => 'title',
206 'size' => 'margin_0 regular',
207 'class' => 'depend_product_btn_position_use_shortcode element_section_title_area message-info',
208 ),
209
210 array(
211 'name' => 'product_custom_hook_message',
212 'headding'=> esc_html__( 'Some themes remove the above positions. In that case, custom position is useful. Here you can place the custom/default hook name & priority to inject & adjust the compare button for the single product page.', 'ever-compare' ),
213 'type' => 'title',
214 'size' => 'margin_0 regular',
215 'class' => 'depend_product_btn_position_custom_hook element_section_title_area message-info',
216 ),
217
218 array(
219 'name' => 'product_custom_hook_name',
220 'label' => __( 'Hook name', 'ever-compare' ),
221 'desc' => __( 'e.g: woocommerce_after_single_product_summary', 'ever-compare' ),
222 'type' => 'text',
223 'class' => 'depend_product_btn_position_custom_hook'
224 ),
225
226 array(
227 'name' => 'product_custom_hook_priority',
228 'label' => __( 'Hook priority', 'ever-compare' ),
229 'desc' => __( 'Default: 10', 'ever-compare' ),
230 'type' => 'text',
231 'class' => 'depend_product_btn_position_custom_hook'
232 ),
233
234 array(
235 'name' => 'open_popup',
236 'label' => __( 'Open popup', 'ever-compare' ),
237 'type' => 'checkbox',
238 'default' => 'on',
239 'desc' => __( 'You can manage the popup window from here.', 'ever-compare' ),
240 ),
241
242 array(
243 'name' => 'button_text',
244 'label' => __( 'Button text', 'ever-compare' ),
245 'desc' => __( 'Enter your compare button text.', 'ever-compare' ),
246 'type' => 'text',
247 'default' => __( 'Compare', 'ever-compare' ),
248 'placeholder' => __( 'Compare', 'ever-compare' ),
249 ),
250
251 array(
252 'name' => 'added_button_text',
253 'label' => __( 'Added button text', 'ever-compare' ),
254 'desc' => __( 'Enter your compare added button text.', 'ever-compare' ),
255 'type' => 'text',
256 'default' => __( 'Added', 'ever-compare' ),
257 'placeholder' => __( 'Added', 'ever-compare' ),
258 ),
259
260 array(
261 'name' => 'remove_button_text',
262 'label' => __( 'Remove button text', 'ever-compare' ),
263 'desc' => __( 'Enter the compare remove button text.', 'ever-compare' ),
264 'type' => 'text',
265 'default' => __( 'Remove', 'ever-compare' ),
266 'placeholder' => __( 'Remove', 'ever-compare' ),
267 'class' => 'depend_remove_on_click',
268 ),
269
270 array(
271 'name' => 'button_icon_type',
272 'label' => esc_html__( 'Button icon type', 'ever-compare' ),
273 'desc' => esc_html__( 'Choose an icon type for the compare button from here.', 'ever-compare' ),
274 'type' => 'select',
275 'default' => 'default',
276 'options' => [
277 'none' => esc_html__( 'None', 'ever-compare' ),
278 'default' => esc_html__( 'Default', 'ever-compare' ),
279 'custom' => esc_html__( 'Custom', 'ever-compare' ),
280 ]
281 ),
282
283 array(
284 'name' => 'button_custom_icon',
285 'label' => esc_html__( 'Button custom icon', 'ever-compare' ),
286 'type' => 'image_upload',
287 'options' => [
288 'button_label' => esc_html__( 'Upload', 'ever-compare' ),
289 'button_remove_label' => esc_html__( 'Remove', 'ever-compare' ),
290 ],
291 'desc' => esc_html__( 'Upload you custom icon from here.', 'ever-compare' ),
292 'class' => 'depend_button_icon_type_custom',
293 ),
294
295 array(
296 'name' => 'added_button_icon_type',
297 'label' => __( 'Added button icon type', 'ever-compare' ),
298 'desc' => __( 'Choose an icon for the compare button from here.', 'ever-compare' ),
299 'type' => 'select',
300 'default' => 'default',
301 'options' => [
302 'none' => esc_html__( 'None', 'ever-compare' ),
303 'default' => esc_html__( 'Default', 'ever-compare' ),
304 'custom' => esc_html__( 'Custom', 'ever-compare' ),
305 ]
306 ),
307
308 array(
309 'name' => 'added_button_custom_icon',
310 'label' => __( 'Added button custom icon', 'ever-compare' ),
311 'type' => 'image_upload',
312 'options' => [
313 'button_label' => esc_html__( 'Upload', 'ever-compare' ),
314 'button_remove_label' => esc_html__( 'Remove', 'ever-compare' ),
315 ],
316 'class' => 'depend_added_button_icon_type_custom',
317 ),
318
319 ),
320
321 'ever_compare_table_settings_tabs' => array(
322
323 array(
324 'name' => 'compare_page',
325 'label' => __( 'Compare page', 'ever-compare' ),
326 'desc' => wp_kses_post('Select a compare page for compare table. It should contain the shortcode <code>[evercompare_table]</code>'),
327 'type' => 'select',
328 'default' => '0',
329 'options' => ever_compare_get_post_list()
330 ),
331
332 array(
333 'name' => 'enable_shareable_link',
334 'label' => __( 'Enable shareable link', 'ever-compare' ),
335 'type' => 'checkbox',
336 'default' => 'off',
337 'desc' => __( 'If you enable this you can easily share your compare page link with specific products.', 'ever-compare' ),
338 ),
339
340 array(
341 'name' => 'linkshare_btn_pos',
342 'label' => __( 'Share link button position', 'ever-compare' ),
343 'type' => 'select',
344 'default' => 'right',
345 'options' => [
346 'left' => __('Left','ever-compare'),
347 'center' => __('Center','ever-compare'),
348 'right' => __('Right','ever-compare')
349 ],
350 'class' => 'depend_enable_shareable_link'
351 ),
352
353 array(
354 'name' => 'shareable_link_button_text',
355 'label' => __( 'Share link button text', 'ever-compare' ),
356 'placeholder' => __( 'Copy shareable link', 'ever-compare' ),
357 'type' => 'text',
358 'class' => 'depend_enable_shareable_link'
359 ),
360
361 array(
362 'name' => 'shareable_link_after_button_text',
363 'label' => __( 'Text to show after link is copied', 'ever-compare' ),
364 'placeholder' => __( 'Copied', 'ever-compare' ),
365 'type' => 'text',
366 'class' => 'depend_enable_shareable_link'
367 ),
368
369 array(
370 'name' => 'limit',
371 'label' => esc_html__( 'Limit', 'ever-compare' ),
372 'desc' => esc_html__( 'You can manage your maximum compare quantity from here.', 'ever-compare' ),
373 'type' => 'number',
374 'min' => 1,
375 'max' => 1500,
376 'step' => 1,
377 'default' => 10,
378 'sanitize_callback' => 'floatval',
379 ),
380
381 array(
382 'name' => 'show_fields',
383 'label' => __('Show fields in table', 'ever-compare'),
384 'desc' => __('Choose which fields should be presented on the product compare page with table.', 'ever-compare'),
385 'type' => 'multicheckshort',
386 'options' => ever_compare_get_available_attributes(),
387 'default' => [
388 'title' => esc_html__( 'title', 'ever-compare' ),
389 'ratting' => esc_html__( 'Rating', 'ever-compare' ),
390 'price' => esc_html__( 'price', 'ever-compare' ),
391 'add_to_cart' => esc_html__( 'add_to_cart', 'ever-compare' ),
392 'description' => esc_html__( 'description', 'ever-compare' ),
393 'availability' => esc_html__( 'availability', 'ever-compare' ),
394 'sku' => esc_html__( 'sku', 'ever-compare' ),
395 'weight' => esc_html__( 'weight', 'ever-compare' ),
396 'dimensions' => esc_html__( 'dimensions', 'ever-compare' ),
397 ],
398 ),
399
400 array(
401 'name' => 'table_heading_section_title',
402 'headding'=> esc_html__( 'Custom heading', 'ever-compare' ),
403 'type' => 'title',
404 'size' => 'margin_0 regular',
405 'class' => 'element_section_title_area',
406 ),
407
408 array(
409 'name' => 'table_heading',
410 'label' => __( 'Fields heading text', 'ever-compare' ),
411 'desc' => __( 'You can change heading text from here.', 'ever-compare' ),
412 'type' => 'multitext',
413 'options' => ever_compare_table_heading()
414 ),
415
416 array(
417 'name' => 'reached_max_limit_message',
418 'label' => __('Reached maximum limit message', 'ever-compare'),
419 'desc' => __('You can manage message for maximum product added in the compare table.', 'ever-compare'),
420 'type' => 'textarea'
421 ),
422
423 array(
424 'name' => 'empty_table_text',
425 'label' => __('Empty compare page text', 'ever-compare'),
426 'desc' => __('Text will be displayed if user don\'t add any products to compare', 'ever-compare'),
427 'type' => 'textarea'
428 ),
429
430 array(
431 'name' => 'shop_button_text',
432 'label' => __( 'Return to shop button text', 'ever-compare' ),
433 'desc' => __( 'Enter your return to shop button text.', 'ever-compare' ),
434 'type' => 'text',
435 'default' => __( 'Return to shop', 'ever-compare' ),
436 'placeholder' => __( 'Return to shop', 'ever-compare' ),
437 ),
438
439 array(
440 'name' => 'image_size',
441 'label' => __( 'Image size', 'ever-compare' ),
442 'desc' => __( 'Enter your required image size.', 'ever-compare' ),
443 'type' => 'multitext',
444 'options' =>[
445 'width' => esc_html__( 'Width', 'ever-compare' ),
446 'height' => esc_html__( 'Height', 'ever-compare' ),
447 ],
448 'default' => [
449 'width' => 300,
450 'height' => 300,
451 ],
452 ),
453
454 array(
455 'name' => 'hard_crop',
456 'label' => __( 'Image Hard Crop', 'ever-compare' ),
457 'type' => 'checkbox',
458 'default' => 'on',
459 ),
460
461 ),
462
463 'ever_compare_style_tabs' => array(
464
465 array(
466 'name' => 'button_style',
467 'label' => esc_html__( 'Button style', 'ever-compare' ),
468 'desc' => esc_html__( 'Choose a style for the compare button from here.', 'ever-compare' ),
469 'type' => 'select',
470 'default' => 'theme',
471 'options' => [
472 'default' => esc_html__( 'Default', 'ever-compare' ),
473 'theme' => esc_html__( 'Theme', 'ever-compare' ),
474 'custom' => esc_html__( 'Custom', 'ever-compare' ),
475 ]
476 ),
477
478 array(
479 'name' => 'table_style',
480 'label' => esc_html__( 'Table style', 'ever-compare' ),
481 'desc' => esc_html__( 'Choose a table style from here.', 'ever-compare' ),
482 'type' => 'select',
483 'default' => 'default',
484 'options' => [
485 'default' => esc_html__( 'Default', 'ever-compare' ),
486 'custom' => esc_html__( 'Custom', 'ever-compare' ),
487 ]
488 ),
489
490 array(
491 'name' => 'notification_style',
492 'label' => __( 'Notification style', 'ever-compare' ),
493 'desc' => __( 'Choose a style for the compare notification here.', 'ever-compare' ),
494 'type' => 'select',
495 'default' => 'default',
496 'options' => [
497 'default' => esc_html__( 'Default', 'ever-compare' ),
498 'custom' => esc_html__( 'Custom', 'ever-compare' ),
499 ]
500 ),
501
502 array(
503 'name' => 'button_custom_style_area_title',
504 'headding'=> esc_html__( 'Button custom style', 'ever-compare' ),
505 'type' => 'title',
506 'size' => 'margin_0 regular',
507 'class' => 'depend_button_custom_style element_section_title_area',
508 ),
509
510 array(
511 'name' => 'button_color',
512 'label' => esc_html__( 'Color', 'ever-compare' ),
513 'desc' => wp_kses_post( __( 'Set the color of the button.', 'ever-compare' ) ),
514 'type' => 'color',
515 'class' => 'depend_button_custom_style',
516 ),
517
518 array(
519 'name' => 'button_hover_color',
520 'label' => esc_html__( 'Hover Color', 'ever-compare' ),
521 'desc' => wp_kses_post( __( 'Set the hover color of the button.', 'ever-compare' ) ),
522 'type' => 'color',
523 'class' => 'depend_button_custom_style',
524 ),
525
526 array(
527 'name' => 'background_color',
528 'label' => esc_html__( 'Background Color', 'ever-compare' ),
529 'desc' => wp_kses_post( __( 'Set the background color of the button.', 'ever-compare' ) ),
530 'type' => 'color',
531 'class' => 'depend_button_custom_style',
532 ),
533
534 array(
535 'name' => 'hover_background_color',
536 'label' => esc_html__( 'Hover Background Color', 'ever-compare' ),
537 'desc' => wp_kses_post( __( 'Set the hover background color of the button.', 'ever-compare' ) ),
538 'type' => 'color',
539 'class' => 'depend_button_custom_style',
540 ),
541
542 array(
543 'name' => 'button_custom_padding',
544 'label' => __( 'Padding', 'ever-compare' ),
545 'type' => 'dimensions',
546 'options' => [
547 'top' => esc_html__( 'Top', 'ever-compare' ),
548 'right' => esc_html__( 'Right', 'ever-compare' ),
549 'bottom'=> esc_html__( 'Bottom', 'ever-compare' ),
550 'left' => esc_html__( 'Left', 'ever-compare' ),
551 'unit' => esc_html__( 'Unit', 'ever-compare' ),
552 ],
553 'class' => 'depend_button_custom_style',
554 ),
555
556 array(
557 'name' => 'button_custom_margin',
558 'label' => __( 'Margin', 'ever-compare' ),
559 'type' => 'dimensions',
560 'options' => [
561 'top' => esc_html__( 'Top', 'ever-compare' ),
562 'right' => esc_html__( 'Right', 'ever-compare' ),
563 'bottom'=> esc_html__( 'Bottom', 'ever-compare' ),
564 'left' => esc_html__( 'Left', 'ever-compare' ),
565 'unit' => esc_html__( 'Unit', 'ever-compare' ),
566 ],
567 'class' => 'depend_button_custom_style',
568 ),
569
570 array(
571 'name' => 'button_custom_border',
572 'label' => __( 'Border width', 'ever-compare' ),
573 'type' => 'dimensions',
574 'options' => [
575 'top' => esc_html__( 'Top', 'ever-compare' ),
576 'right' => esc_html__( 'Right', 'ever-compare' ),
577 'bottom'=> esc_html__( 'Bottom', 'ever-compare' ),
578 'left' => esc_html__( 'Left', 'ever-compare' ),
579 'unit' => esc_html__( 'Unit', 'ever-compare' ),
580 ],
581 'class' => 'depend_button_custom_style',
582 ),
583 array(
584 'name' => 'button_custom_border_color',
585 'label' => esc_html__( 'Border Color', 'ever-compare' ),
586 'desc' => wp_kses_post( __( 'Set the border color of the button.', 'ever-compare' ) ),
587 'type' => 'color',
588 'class' => 'depend_button_custom_style',
589 ),
590
591 array(
592 'name' => 'button_custom_border_radius',
593 'label' => __( 'Border Radius', 'ever-compare' ),
594 'type' => 'dimensions',
595 'options' => [
596 'top' => esc_html__( 'Top', 'ever-compare' ),
597 'right' => esc_html__( 'Right', 'ever-compare' ),
598 'bottom'=> esc_html__( 'Bottom', 'ever-compare' ),
599 'left' => esc_html__( 'Left', 'ever-compare' ),
600 'unit' => esc_html__( 'Unit', 'ever-compare' ),
601 ],
602 'class' => 'depend_button_custom_style',
603 ),
604
605 array(
606 'name' => 'table_custom_style_area_title',
607 'headding'=> esc_html__( 'Table custom style', 'ever-compare' ),
608 'type' => 'title',
609 'size' => 'margin_0 regular',
610 'class' => 'depend_table_custom_style element_section_title_area',
611 ),
612
613 array(
614 'name' => 'table_border_color',
615 'label' => esc_html__( 'Border color', 'ever-compare' ),
616 'desc' => wp_kses_post( __( 'Set the border color of the table.', 'ever-compare' ) ),
617 'type' => 'color',
618 'class' => 'depend_table_custom_style',
619 ),
620
621 array(
622 'name' => 'table_column_padding',
623 'label' => __( 'Column Padding', 'ever-compare' ),
624 'type' => 'dimensions',
625 'options' => [
626 'top' => esc_html__( 'Top', 'ever-compare' ),
627 'right' => esc_html__( 'Right', 'ever-compare' ),
628 'bottom'=> esc_html__( 'Bottom', 'ever-compare' ),
629 'left' => esc_html__( 'Left', 'ever-compare' ),
630 'unit' => esc_html__( 'Unit', 'ever-compare' ),
631 ],
632 'class' => 'depend_table_custom_style',
633 ),
634
635 array(
636 'name' => 'table_event_color',
637 'label' => esc_html__( 'Column background color (Event)', 'ever-compare' ),
638 'desc' => wp_kses_post( __( 'Set the background color of the table event column.', 'ever-compare' ) ),
639 'type' => 'color',
640 'class' => 'depend_table_custom_style',
641 ),
642
643 array(
644 'name' => 'table_odd_color',
645 'label' => esc_html__( 'Column background color (Odd)', 'ever-compare' ),
646 'desc' => wp_kses_post( __( 'Set the background color of the table odd column.', 'ever-compare' ) ),
647 'type' => 'color',
648 'class' => 'depend_table_custom_style',
649 ),
650
651 array(
652 'name' => 'table_heading_event_color',
653 'label' => esc_html__( 'Heading color (Event)', 'ever-compare' ),
654 'desc' => wp_kses_post( __( 'Set the heading color of the table event column.', 'ever-compare' ) ),
655 'type' => 'color',
656 'class' => 'depend_table_custom_style',
657 ),
658
659 array(
660 'name' => 'table_heading_odd_color',
661 'label' => esc_html__( 'Heading color (Odd)', 'ever-compare' ),
662 'desc' => wp_kses_post( __( 'Set the heading color of the table odd column.', 'ever-compare' ) ),
663 'type' => 'color',
664 'class' => 'depend_table_custom_style',
665 ),
666
667 array(
668 'name' => 'table_content_event_color',
669 'label' => esc_html__( 'Content color (Event)', 'ever-compare' ),
670 'desc' => wp_kses_post( __( 'Set the content color of the table event column.', 'ever-compare' ) ),
671 'type' => 'color',
672 'class' => 'depend_table_custom_style',
673 ),
674
675 array(
676 'name' => 'table_content_odd_color',
677 'label' => esc_html__( 'Content color (Odd)', 'ever-compare' ),
678 'desc' => wp_kses_post( __( 'Set the content color of the table odd column.', 'ever-compare' ) ),
679 'type' => 'color',
680 'class' => 'depend_table_custom_style',
681 ),
682
683 array(
684 'name' => 'table_content_link_color',
685 'label' => esc_html__( 'Content link color', 'ever-compare' ),
686 'desc' => wp_kses_post( __( 'Set the content link color of the table.', 'ever-compare' ) ),
687 'type' => 'color',
688 'class' => 'depend_table_custom_style',
689 ),
690
691 array(
692 'name' => 'table_content_link_hover_color',
693 'label' => esc_html__( 'Content link hover color', 'ever-compare' ),
694 'desc' => wp_kses_post( __( 'Set the content link hover color of the table.', 'ever-compare' ) ),
695 'type' => 'color',
696 'class' => 'depend_table_custom_style',
697 ),
698
699 array(
700 'name' => 'notification_custom_style_title',
701 'headding'=> __( 'Notification custom style', 'ever-compare' ),
702 'type' => 'title',
703 'size' => 'margin_0 regular',
704 'class' => 'depend_notification_custom_style element_section_title_area',
705 ),
706
707 array(
708 'name' => 'notification_bg_color',
709 'label' => esc_html__( 'Background Color', 'ever-compare' ),
710 'desc' => __( 'Set the background color of the notification.', 'ever-compare' ),
711 'type' => 'color',
712 'class' => 'depend_notification_custom_style',
713 ),
714 array(
715 'name' => 'notification_border_color',
716 'label' => esc_html__( 'Border Color', 'ever-compare' ),
717 'desc' => __( 'Set the border color of the notification.', 'ever-compare' ),
718 'type' => 'color',
719 'class' => 'depend_notification_custom_style',
720 ),
721 array(
722 'name' => 'notification_text_color',
723 'label' => esc_html__( 'Content Color', 'ever-compare' ),
724 'desc' => __( 'Set the content color of the notification.', 'ever-compare' ),
725 'type' => 'color',
726 'class' => 'depend_notification_custom_style',
727 ),
728 array(
729 'name' => 'notification_btn_color',
730 'label' => esc_html__( 'Close Button Color', 'ever-compare' ),
731 'desc' => __( 'Set the close button color of the notification.', 'ever-compare' ),
732 'type' => 'color',
733 'class' => 'depend_notification_custom_style',
734 ),
735 array(
736 'name' => 'notification_btn_color_hover',
737 'label' => esc_html__( 'Close Button Hover Color', 'ever-compare' ),
738 'desc' => __( 'Set the close button hover color of the notification.', 'ever-compare' ),
739 'type' => 'color',
740 'class' => 'depend_notification_custom_style',
741 ),
742
743 ),
744
745 );
746
747 return $settings_fields;
748 }
749
750 public function plugin_page() {
751 echo '<div class="wrap">';
752 echo '<h2>'.esc_html__( 'Compare Settings','ever-compare' ).'</h2>';
753 $this->save_message();
754 $this->settings_api->show_navigation();
755 $this->settings_api->show_forms();
756 echo '</div>';
757 }
758
759 public function save_message() {
760 if( isset( $_GET['settings-updated'] ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
761 ?>
762 <div class="updated notice is-dismissible">
763 <p><strong><?php esc_html_e('Successfully Settings Saved.', 'ever-compare') ?></strong></p>
764 </div>
765 <?php
766 }
767 }
768
769 }