-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsite.php
31 lines (30 loc) · 971 Bytes
/
site.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
<?php
class front {
static function get_last_featured() {
$query = new WP_Query(array(
'post_type' => 'cc_chfeature',
'posts_per_page' => 1,
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'DESC'
));
if ($query->have_posts()) {
return $query->posts[0];
} else {
return false;
}
}
static function get_sidebar_class($sidebar) {
global $_set;
$settings = $_set->settings;
if (!empty($settings[$sidebar.'-background'])) {
return ' '.$settings[$sidebar.'-background'];
}
}
static function prevent_multisite_signup() {
wp_redirect('https://network.creativecommons.org', 301);
die();
}
}
//Redirect to CCGN when website does not exists
add_action( 'before_signup_header', array( 'front', 'prevent_multisite_signup' ) );