-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_themes.php
executable file
·72 lines (51 loc) · 2.11 KB
/
admin_themes.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/*
Plugin Name: _ANDYP - Admin - Themes
Plugin URI: https://londonparkour.com
Description: Adds custom color themes for the admin dashboard.
Version: 1.0.0
Author: Andy Pearson
Author URI: https://londonparkour.com
*/
// ┌─────────────────────────────────────────────────────────────────────────┐
// │ Register with ANDYP Plugins │
// └─────────────────────────────────────────────────────────────────────────┘
require __DIR__.'/src/acf/andyp_plugin_register.php';
require __DIR__.'/src/remove_comments_menu.php';
function andyp_additional_admin_color_schemes() {
wp_admin_css_color(
'dev',
__( 'dev.londonparkour.com' ),
plugins_url( '/', __FILE__ ) . '/css/dev.londonparkour.com.css' ,
[ '#242424', '#53A5E3', '#E86546' ]
);
wp_admin_css_color(
'pulse',
__( 'dev.pulse.londonparkour.com' ),
plugins_url( '/', __FILE__ ) . '/css/dev.pulse.londonparkour.com.css' ,
[ '#242424', '#E86546', '#FAFAFA' ]
);
wp_admin_css_color(
'labs',
__( 'dev.labs.londonparkour.com' ),
plugins_url( '/', __FILE__ ) . '/css/dev.labs.londonparkour.com.css' ,
[ '#242424', '#38EF7D', '#ffffff' ]
);
}
add_action( 'admin_init', 'andyp_additional_admin_color_schemes' );
// Switch based on domain.
add_filter('get_user_option_admin_color', 'switch_admin_scheme');
function switch_admin_scheme($result) {
$site = get_site_url();
// Dev: use 'dev' color scheme
if((strpos($site, 'dev.londonparkour.com') !== false)) {
return 'dev';
}
if((strpos($site, 'labs.londonparkour.com') !== false)) {
return 'labs';
}
if((strpos($site, 'pulse.londonparkour.com') !== false)) {
return 'pulse';
}
return 'dev';
} ?>