PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 1.4.23
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v1.4.23
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.4.23, at src/Includes/DarkifyExternalSupport.php

169 lines 5.7 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 $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 /* =============== Slider Revolution =============== */
48 if(class_exists('RevSliderFront')){
49 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByRevSlider());
50 }
51
52 /* =============== OneSignal Push Notifications =============== */
53 if(class_exists('OneSignal_Public')){
54 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByOneSignal());
55 }
56
57 /* =============== Read Meter =============== */
58 if(class_exists('BSFRT_Loader')){
59 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByReadMeter());
60 }
61
62
63 return $disallowed_elements;
64 }
65
66 /* =============== Default Darkify Ignore =============== */
67 public function getDisallowedElementsByDarkify()
68 {
69 return array(
70 ".darkify_ignore",
71 ".darkify_ignore *",
72 ".darkify_switch",
73 ".darkify_switch *",
74 );
75 }
76
77 /* =============== Logged-in as Admin =============== */
78 public function getDisallowedElementsByAdminLogin()
79 {
80 return array(
81 "#wpadminbar",
82 "#wpadminbar *",
83 );
84 }
85
86 /* =============== Is in Admin Panel =============== */
87 public function getDisallowedElementsByAdminPanel()
88 {
89 return array(
90 "#wpadminbar",
91 "#wpadminbar *",
92 "#adminmenumain",
93 "#adminmenumain *",
94 ".wp-core-ui .button-primary",
95 ".wp-core-ui .button-primary *",
96 ".post-com-count-approved",
97 ".post-com-count-approved *",
98 ".darkify--switcher",
99 ".darkify--switcher *",
100 ".darkify-slider-ui",
101 ".darkify-slider-ui *",
102 ".CodeMirror",
103 ".CodeMirror *",
104 ".wp-picker-container",
105 ".wp-picker-container *",
106 ".darkify--sibling.darkify--image *",
107 ".darkify_preset .darkify--sibling",
108 ".darkify_preset .darkify--sibling *",
109 ".button",
110 ".darkify-tooltip",
111 ".darkify-tooltip *",
112 ".rll-youtube-player .play",
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 /* =============== Slider Revolution =============== */
142 public function getDisallowedElementsByRevSlider()
143 {
144 return array(
145 "rs-fullwidth-wrap",
146 "rs-fullwidth-wrap *",
147 );
148 }
149
150 /* =============== OneSignal Push Notifications =============== */
151 public function getDisallowedElementsByOneSignal()
152 {
153 return array(
154 ".onesignal-slidedown-dialog",
155 ".onesignal-slidedown-dialog *",
156 );
157 }
158
159 /* =============== Read Meter =============== */
160 public function getDisallowedElementsByReadMeter()
161 {
162 return array(
163 "#bsf_rt_progress_bar_container",
164 "#bsf_rt_progress_bar_container *",
165 );
166 }
167 }
168 }
169