PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 1.3.2
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v1.3.2
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 / Helpers / DarkifyExternalSupport.php

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

179 lines 6.0 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\Helpers;
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 $disallowed_elements = array();
17
18 /* =============== Default Darkify Ignore =============== */
19 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByDarkify());
20
21 /* =============== Logged-in as Admin =============== */
22 if(function_exists("is_admin_bar_showing")){
23 if(is_admin_bar_showing()){
24 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByAdminLogin());
25 }
26 }
27
28 /* =============== Is in Admin Panel =============== */
29 if(function_exists("is_admin")){
30 if(is_admin()){
31 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByAdminPanel());
32 }
33 }
34
35 /* =============== Elementor =============== */
36 if(function_exists("is_plugin_active")){
37 if (is_plugin_active( 'elementor/elementor.php' )) {
38 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByElementor());
39 }
40 }
41
42 /* =============== Beaver Builder =============== */
43 if ( class_exists( 'FLBuilder' ) ) {
44 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByBeaver());
45 }
46
47 /* =============== Block Editor =============== */
48 if(function_exists("has_blocks")){
49 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByBlockEditor());
50 }
51
52 /* =============== Slider Revolution =============== */
53 if(class_exists('RevSliderFront')){
54 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByRevSlider());
55 }
56
57 /* =============== OneSignal Push Notifications =============== */
58 if(class_exists('OneSignal_Public')){
59 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByOneSignal());
60 }
61
62 /* =============== Read Meter =============== */
63 if(class_exists('BSFRT_Loader')){
64 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByReadMeter());
65 }
66
67
68 return $disallowed_elements;
69 }
70
71 /* =============== Default Darkify Ignore =============== */
72 public function getDisallowedElementsByDarkify()
73 {
74 return array(
75 ".darkify_ignore",
76 ".darkify_ignore *",
77 ".darkify_switch",
78 ".darkify_switch *",
79 );
80 }
81
82 /* =============== Logged-in as Admin =============== */
83 public function getDisallowedElementsByAdminLogin()
84 {
85 return array(
86 "#wpadminbar",
87 "#wpadminbar *",
88 );
89 }
90
91 /* =============== Is in Admin Panel =============== */
92 public function getDisallowedElementsByAdminPanel()
93 {
94 return array(
95 "#wpadminbar",
96 "#wpadminbar *",
97 "#adminmenumain",
98 "#adminmenumain *",
99 ".wp-core-ui .button-primary",
100 ".wp-core-ui .button-primary *",
101 ".post-com-count-approved",
102 ".post-com-count-approved *",
103 ".darkify--switcher",
104 ".darkify--switcher *",
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 );
114 }
115
116
117 /* =============== Elementor =============== */
118 public function getDisallowedElementsByElementor()
119 {
120 return array(
121 ".elementor-background-overlay",
122 ".elementor-element-overlay",
123 ".elementor-button-link",
124 ".elementor-button-link *",
125 ".elementor-widget-spacer",
126 ".elementor-widget-spacer *",
127 );
128 }
129
130
131
132 /* =============== Beaver Builder =============== */
133 public function getDisallowedElementsByBeaver()
134 {
135 return array(
136 ".uabb-button",
137 ".uabb-button *",
138 );
139 }
140
141
142 /* =============== Block Editor =============== */
143 public function getDisallowedElementsByBlockEditor()
144 {
145 return array(
146 ".wp-block-button__link",
147 ".wp-block-button__link *",
148 );
149 }
150
151 /* =============== Slider Revolution =============== */
152 public function getDisallowedElementsByRevSlider()
153 {
154 return array(
155 "rs-fullwidth-wrap",
156 "rs-fullwidth-wrap *",
157 );
158 }
159
160 /* =============== OneSignal Push Notifications =============== */
161 public function getDisallowedElementsByOneSignal()
162 {
163 return array(
164 ".onesignal-slidedown-dialog",
165 ".onesignal-slidedown-dialog *",
166 );
167 }
168
169 /* =============== Read Meter =============== */
170 public function getDisallowedElementsByReadMeter()
171 {
172 return array(
173 "#bsf_rt_progress_bar_container",
174 "#bsf_rt_progress_bar_container *",
175 );
176 }
177 }
178 }
179