PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 2.1.3
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v2.1.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
← All changes | src/Frontend/DarkifyShortcode.php +11 -0 2.0.22.1.3 View file →
@@ -23,8 +23,19 @@
23 23 }
24 24
25 25 public function darkify_shortcode_parser($atts, $content = null)
26 26 {
27 + // With Frontend Dark Mode off, client_main.css/.js are never
28 + // enqueued on the front end, so rendering the switch markup anyway
29 + // leaves an unstyled toggle behind that does nothing when clicked.
30 + // Gate every switch entry point here: the Gutenberg block and the
31 + // Elementor widget both render through this shortcode. The floating
32 + // switch, menu switch and inline scripts are already gated in
33 + // Frontend.php.
34 + if (! $this->base_client->darkify_is_dark_mode_allowed()) {
35 + return '';
36 + }
37 +
27 38 $options = get_option('darkify');
28 39
29 40 // Background
30 41 $switch_background = isset($options['switch_background']) ? $options['switch_background'] : [];