-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblog-suspended.php
executable file
·89 lines (75 loc) · 2.17 KB
/
blog-suspended.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
<?php
/*
Plugin Name: Suspended Site
Plugin URI: http://sequoiaims.com
Description: Custom page and styles for suspended site page
Author: Ryan Olson
Author URI: http://thatryan.com
Version: 1.0.0
*/
// Return header to remove from search engines
status_header(410);
// Output the header for the suspended page
function suspended_page_header( ) {
// Don't index any of this
add_action( 'login_head', 'wp_no_robots' );
// Create the head markup
?><!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<title><?php bloginfo('name'); ?> → Website Suspended</title>
<?php
// Include the standard styling for the login page
// to maintain some consistency
wp_admin_css( 'login', true );
// Enqueue scripts and styles for the login page
do_action( 'login_enqueue_scripts' );
/**
* Fires in the login page header after scripts are enqueued.
*/
do_action( 'login_head' );
// Get the current site infos
$login_header_url = network_home_url();
$login_header_title = get_current_site()->site_name; ?>
<style type="text/css" media="screen">
.suspended-message {
margin-top: 20px;
margin-left: 0;
padding: 14px;
text-align: center;
background: #fff;
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,.13);
box-shadow: 0 1px 3px rgba(0,0,0,.13);
}
.suspended-message h2 {
line-height: 1.25;
}
</style>
</head>
<body class="login suspended-site">
<div id="login">
<h1>
<a href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a>
</h1>
</div>
<?php
}
// End suspended_page_header()
// Output the footer for the suspended page
function suspended_page_footer() {
// Fire the login_footer action to allow any other custom scripts/styles
do_action( 'login_footer' ); ?>
</body>
</html>
<?php
}
// Create the content of the page
nocache_headers();
header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset'));
suspended_page_header(); ?>
<div class="suspended-message">
<h2>Website is currently unavailable.</h2>
</div>
<?php
suspended_page_footer();