PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 1.4.21
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v1.4.21
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 / DarkifyAssets.php

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

45 lines 963 B
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
6 class DarkifyAssets
7 {
8 /**
9 * Requested switcher variants for the current request.
10 *
11 * @var array<string,bool>
12 */
13 private static $requested_variants = array();
14
15 /**
16 * Whether we've detected at least one [darkify] shortcode on the page.
17 *
18 * @var bool
19 */
20 private static $has_shortcode = false;
21
22 public static function request_variant($variant)
23 {
24 $variant = sanitize_key((string) $variant);
25 if (!$variant) {
26 return;
27 }
28 self::$requested_variants[$variant] = true;
29 }
30
31 public static function get_requested_variants()
32 {
33 return array_keys(self::$requested_variants);
34 }
35
36 public static function set_has_shortcode($has_shortcode)
37 {
38 self::$has_shortcode = (bool) $has_shortcode;
39 }
40
41 public static function has_shortcode()
42 {
43 return self::$has_shortcode;
44 }
45 }