PluginProbe
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar / 1.1.3
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar v1.1.3
3.3.1 3.3.0 3.2.14 3.2.13 3.2.12 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 trunk 0.2.5.5 0.2.5.6 0.2.5.7 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.2.1 All 156 releases
notificationx / includes / class-toggle-helper.php

class-toggle-helper.php in NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar 1.1.3, at includes/class-toggle-helper.php

105 lines 3.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * This class will provide all kind of helper methods.
4 */
5 class NotificationX_ToggleFields {
6
7 public static function common_fields(){
8 $common_fields = apply_filters( 'nx_meta_common_fields', array(
9 'conversion_position',
10 'delay_before',
11 'display_last',
12 'display_from',
13 'display_for',
14 'delay_between',
15 'loop',
16 'notification_preview',
17 'conversion_size'
18 ) );
19 return $common_fields;
20 }
21
22 public static function common_sections(){
23 $common_sections = apply_filters( 'nx_meta_common_sections', array(
24 'image',
25 'sound',
26 ) );
27 return $common_sections;
28 }
29
30 public static function woocommerce(){
31
32 $fields = self::common_fields();
33 $fields[] = 'conversion_from';
34 $sections = self::common_sections();
35 $sections[] = 'themes';
36 $sections[] = 'conversion_link_options';
37
38 return apply_filters( 'nx_woocommerce_toggle_fields', array(
39 'fields' => $fields,
40 'sections' => $sections,
41 ));
42 }
43
44 public static function woocommerce_hide(){
45 return apply_filters( 'nx_woocommerce_toggle_fields', array(
46 'fields' => [ 'comments_template' ],
47 'sections' => [],
48 ));
49 }
50
51 public static function edd(){
52 $fields = self::common_fields();
53 $fields[] = 'woo_template_new';
54 $fields[] = 'woo_template_adv';
55 $fields[] = 'conversion_from';
56
57 $sections = self::common_sections();
58 $sections[] = 'themes';
59 $sections[] = 'conversion_link_options';
60
61 return apply_filters( 'nx_edd_toggle_fields', array(
62 'fields' => $fields,
63 'sections' => $sections,
64 ));
65 }
66
67 public static function edd_hide(){
68 return apply_filters( 'nx_edd_toggle_fields', array(
69 'fields' => [ 'comments_template' ],
70 'sections' => [],
71 ));
72 }
73
74 public static function reviews(){
75 $fields = self::common_fields();
76 $sections = self::common_sections();
77
78 return apply_filters( 'nx_reviews_toggle_fields', array(
79 'fields' => array_merge( $fields, array( 'reviews_source' ) ),
80 'sections' => $sections,
81 ));
82 }
83
84 public static function stats(){
85 $fields = self::common_fields();
86 $sections = self::common_sections();
87
88 return apply_filters( 'nx_stats_toggle_fields', array(
89 'fields' => array_merge( $fields, array( 'stats_source' ) ),
90 'sections' => $sections,
91 ));
92 }
93
94 public static function comments(){
95 $fields = self::common_fields();
96 $sections = self::common_sections();
97
98 return apply_filters( 'nx_comments_toggle_data', array(
99 'fields' => array_merge( $fields, array( 'comments_source', 'comments_template_new', 'comments_template_adv', 'show_avatar' ) ),
100 'sections' => array_merge( $sections, array( 'link_options', 'comment_themes' ) ),
101 ));
102 }
103
104 }
105