PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 1.5.3
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v1.5.3
2.1.3 2.1.2 2.1.1 2.1.0 2.0.4 2.0.3 2.0.2 2.0.1 2.0.0 1.5.5 1.5.4 1.5.3 1.5.2 1.5.1 1.5.0 trunk 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 All 57 releases
darkify / src / Includes / DarkifyExternalSupport.php

DarkifyExternalSupport.php in Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) 1.5.3, at src/Includes/DarkifyExternalSupport.php

184 lines 6.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ThemeAtelier\Darkify\Includes;
4
5 if (! class_exists('DarkifyExternalSupport')) {
6 class DarkifyExternalSupport
7 {
8
9 public $base_admin;
10 public function __construct($base_admin)
11 {
12 $this->base_admin = $base_admin;
13 }
14
15 public function getDisallowedElementsByAvailablePlugins()
16 {
17 $disallowed_elements = array();
18
19 /* =============== Default Darkify Ignore =============== */
20 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByDarkify());
21
22 /* =============== Logged-in as Admin =============== */
23 if (function_exists("is_admin_bar_showing")) {
24 if (is_admin_bar_showing()) {
25 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByAdminLogin());
26 }
27 }
28
29 /* =============== Is in Admin Panel =============== */
30 if (function_exists("is_admin")) {
31 if (is_admin()) {
32 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByAdminPanel());
33 }
34 }
35
36 /* =============== Elementor =============== */
37 if (function_exists("is_plugin_active")) {
38 if (is_plugin_active('elementor/elementor.php')) {
39 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByElementor());
40 }
41 }
42
43 /* =============== Beaver Builder =============== */
44 if (class_exists('FLBuilder')) {
45 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByBeaver());
46 }
47
48 /* =============== Slider Revolution =============== */
49 if (class_exists('RevSliderFront')) {
50 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByRevSlider());
51 }
52
53 /* =============== OneSignal Push Notifications =============== */
54 if (class_exists('OneSignal_Public')) {
55 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByOneSignal());
56 }
57
58 /* =============== Read Meter =============== */
59 if (class_exists('BSFRT_Loader')) {
60 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByReadMeter());
61 }
62
63
64 return $disallowed_elements;
65 }
66
67 /* =============== Default Darkify Ignore =============== */
68 public function getDisallowedElementsByDarkify()
69 {
70 return array(
71 ".darkify_ignore",
72 ".darkify_ignore *",
73 ".darkify_switch",
74 ".darkify_switch *",
75 ".wp-block-btn-button .btnButton",
76 ".wp-block-btn-button .btnButton *",
77 );
78 }
79
80 /* =============== Logged-in as Admin =============== */
81 public function getDisallowedElementsByAdminLogin()
82 {
83 return array(
84 "#wpadminbar",
85 "#wpadminbar *",
86 );
87 }
88
89 /* =============== Is in Admin Panel =============== */
90 public function getDisallowedElementsByAdminPanel()
91 {
92 return array(
93 "#wpadminbar",
94 "#wpadminbar *",
95 "#adminmenumain",
96 "#adminmenumain *",
97 ".wp-core-ui .button-primary",
98 ".wp-core-ui .button-primary *",
99 ".post-com-count-approved",
100 ".post-com-count-approved *",
101 ".darkify--switcher",
102 ".darkify--switcher *",
103 ".darkify-slider-ui",
104 ".darkify-slider-ui *",
105 ".CodeMirror",
106 ".CodeMirror *",
107 ".wp-picker-container",
108 ".wp-picker-container *",
109 ".darkify--sibling.darkify--image *",
110 ".darkify_preset .darkify--sibling",
111 ".darkify_preset .darkify--sibling *",
112 ".button",
113 ".darkify-tooltip",
114 ".darkify-tooltip *",
115 ".rll-youtube-player .play",
116 "button.components-color-palette__custom-color-button",
117 ".react-colorful__saturation",
118 ".react-colorful__hue.react-colorful__last-control",
119 ".block-editor-color-gradient-control__panel",
120 ".block-editor-color-gradient-control__panel *",
121 ".components-z-stack",
122 ".components-z-stack *",
123 ".theme_color",
124 ".themeatelier_license_notice",
125 ".themeatelier_license_notice *",
126 "#themeatelier-offer-banner",
127 "#themeatelier-offer-banner *",
128 );
129 }
130
131
132 /* =============== Elementor =============== */
133 public function getDisallowedElementsByElementor()
134 {
135 return array(
136 ".elementor-background-overlay",
137 ".elementor-element-overlay",
138 // ".elementor-button-link",
139 // ".elementor-button-link *",
140 ".elementor-widget-spacer",
141 ".elementor-widget-spacer *",
142 );
143 }
144
145
146
147 /* =============== Beaver Builder =============== */
148 public function getDisallowedElementsByBeaver()
149 {
150 return array(
151 ".uabb-button",
152 ".uabb-button *",
153 );
154 }
155
156 /* =============== Slider Revolution =============== */
157 public function getDisallowedElementsByRevSlider()
158 {
159 return array(
160 "rs-fullwidth-wrap",
161 "rs-fullwidth-wrap *",
162 );
163 }
164
165 /* =============== OneSignal Push Notifications =============== */
166 public function getDisallowedElementsByOneSignal()
167 {
168 return array(
169 ".onesignal-slidedown-dialog",
170 ".onesignal-slidedown-dialog *",
171 );
172 }
173
174 /* =============== Read Meter =============== */
175 public function getDisallowedElementsByReadMeter()
176 {
177 return array(
178 "#bsf_rt_progress_bar_container",
179 "#bsf_rt_progress_bar_container *",
180 );
181 }
182 }
183 }
184