-
Notifications
You must be signed in to change notification settings - Fork 1
/
disciple-tools-multisite.php
151 lines (151 loc) · 4.58 KB
/
disciple-tools-multisite.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
/**
* Plugin Name: Disciple Tools - Multisite
* Plugin URI: https://github.com/DiscipleTools/disciple-tools-multisite
* Description: Small plugin to be added to modify a multisite "Disciple Tools" environment.
* Version: 1.0
*/
/**
* Set the new blog theme to Disciple Tools.
*/
define('WP_DEFAULT_THEME', 'disciple-tools-theme');
function dt_new_blog_force_dt_theme( $blog_id, $user_id, $domain, $path, $site_id, $meta ) { define('WP_DEFAULT_THEME', 'disciple-tools-theme');
update_blog_option( $blog_id,'template','disciple-tools-theme' );
update_blog_option( $blog_id,'stylesheet','disciple-tools-theme' );
update_blog_option( $blog_id,'current_theme','Disciple Tools' );
}
add_action( 'wpmu_new_blog', 'dt_new_blog_force_dt_theme', 10, 6 );
/**
* Dev functions for easily logging
*/
if ( ! function_exists( 'dt_write_log' ) ) {
/**
* A function to assist development only.
* This function allows you to post a string, array, or object to the WP_DEBUG log.
*
* @param $log
*/
function dt_write_log( $log )
{
if ( true === WP_DEBUG ) {
if ( is_array( $log ) || is_object( $log ) ) {
error_log( print_r( $log, true ) );
} else {
error_log( $log );
}
}
}
}
function dt_multisite_disable_arvada_header() {
?>
<style type="text/css">
#fusion-slider-3 {display:none;}
#privacy {display:none;}
#signup-content input#signupuser {
display: none;
}
#signup-content label[for=signupuser] {
display: none;
font-size: 0;
}
#signup-content h2 {
color: white;
}
#signup-content a {
text-decoration: underline;
}
#signup-content .mu_register {
margin: 30px auto;
width: 50%;
}
#signup-content input#signupblog {
display: none;
}
#signup-content label[for=signupblog] {
display: none;
font-size: 0;
}
.mu_register input[name="submit"] {
background: #d1e990;
text-transform: uppercase;
color: #6e9a1f;
font-size: 18px !important;
font-weight: 700;
background-image: -webkit-gradient( linear, left bottom, left top, from( #aad75b ), to( #d1e990 ) );
background-image: linear-gradient( to top, #aad75b, #d1e990 );
background-image: -webkit-linear-gradient( to top, #aad75b, #d1e990 );
background-image: -moz-linear-gradient( to top, #aad75b, #d1e990 );
background-image: -ms-linear-gradient( to top, #aad75b, #d1e990 );
background-image: -o-linear-gradient( to top, #aad75b, #d1e990 );
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#d1e990, endColorstr=#aad75b);
transition: all .2s;
border-width: 0px;
border-style: solid;
border-color: #6e9a1f;
border-radius: 2px;
-webkit-transition: all .2s;
-moz-transition: all .2s;
-ms-transition: all .2s;
-o-transition: all .2s;
-webkit-border-radius: 2px;
padding: 9px 20px;
width: auto !important;
}
@media only screen and (max-width: 768px) {
/* For mobile phones: */
#signup-content .mu_register {
margin: 30px auto;
width: 100%;
}
.mu_register input[name="submit"] {
font-size: 18px !important;
font-weight: 700;
}
}
</style>
<?php
}
add_action( 'signup_header', 'dt_multisite_disable_arvada_header' );
function dt_head(){
?>
<style type="text/css">
.home .fusion-button {
background: #d1e990;
text-transform: uppercase;
color: #6e9a1f;
background-image: -webkit-gradient( linear, left bottom, left top, from( #aad75b ), to( #d1e990 ) );
background-image: linear-gradient( to top, #aad75b, #d1e990 );
background-image: -webkit-linear-gradient( to top, #aad75b, #d1e990 );
background-image: -moz-linear-gradient( to top, #aad75b, #d1e990 );
background-image: -ms-linear-gradient( to top, #aad75b, #d1e990 );
background-image: -o-linear-gradient( to top, #aad75b, #d1e990 );
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#d1e990, endColorstr=#aad75b);
transition: all .2s;
border-width: 0px;
border-style: solid;
border-color: #6e9a1f;
border-radius: 2px;
-webkit-transition: all .2s;
-moz-transition: all .2s;
-ms-transition: all .2s;
-o-transition: all .2s;
-webkit-border-radius: 2px;
}
#signup-content h2 {
color: white;
}
#signup-content .wp-activate-container {
margin: 30px auto;
width: 50%;
}
@media only screen and (max-width: 768px) {
/* For mobile phones: */
#signup-content .wp-activate-container {
margin: 30px auto;
width: 100%;
}
}
</style>
<?php
}
add_action( 'wp_head', 'dt_head' );