-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhhdev-wp-admin-add-dark-mode-scheme.php
48 lines (40 loc) · 1.23 KB
/
hhdev-wp-admin-add-dark-mode-scheme.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* Plugin Name: HHdev Dark Mode Scheme for WP Dashboard
* Plugin URI: https://haha.nl/wordpress-plug-in-op-maat/
* Description: Add dark mode scheme for the WordPress dashboard user profile. Based on the Dark Mode for WP Dashboard CSS file.
* Author: herbert hoekstra - haha.nl - hrbrt.dev
* Author URI: https://haha.nl
* Version: 1.0.5
*/
if ( ! defined( 'ABSPATH' ) ) {
die();
}
// add the darkmode color scheme
function hhdev_additional_admin_color_schemes() {
//Darkmode
wp_admin_css_color( 'darkmode', __( 'Dark Mode' ),
esc_url( plugins_url('css/dark-mode-dashboard.css',__FILE__)),
array( '#191f25', '#23282d', '#d54e21', '#3858e9' )
);
}
add_action('admin_init', 'hhdev_additional_admin_color_schemes');
// force set default color scheme to darkmode
// SET OFF
function hhdev_update_user_option_admin_color( $color_scheme ) {
$color_scheme = 'darkmode';
return $color_scheme;
}
//add_filter( 'get_user_option_admin_color', 'hhdev_update_user_option_admin_color', 5 );
/*
change log
1.0.1 initial relaease
1.0.2 color array update
1.0.3 added Avada theme dark css
1.0.4 added flatsome theme dark css
1.0.5 added limit login attempts dark css
*/
/*
TO DO
* add support for other themes dark modes
*/