wp_maintenance [ WordPress Function ]
| Access: |
|
| Defined at: |
|
Dies with a maintenance message when conditions are met.
Checks for a file in the WordPress root directory named ".maintenance". This file will contain the variable $upgrading, set to the time the file was created. If the file was created less than 10 minutes ago, WordPress enters maintenance mode and displays a message.
The default message can be replaced by using a drop-in (maintenance.php in the wp-content directory).
Source
<?php
function wp_maintenance() {
if ( !file_exists( ABSPATH . '.maintenance' ) || defined( 'WP_INSTALLING' ) )
return;
global $upgrading;
include( ABSPATH . '.maintenance' );
// If the $upgrading timestamp is older than 10 minutes, don't die.
if ( ( time() - $upgrading ) >= 600 )
return;
if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) {
require_once( WP_CONTENT_DIR . '/maintenance.php' );
die();
}
wp_load_translations_early();
$protocol = $_SERVER["SERVER_PROTOCOL"];
if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol )
$protocol = 'HTTP/1.0';
header( "$protocol 503 Service Unavailable", true, 503 );
header( 'Content-Type: text/html; charset=utf-8' );
header( 'Retry-After: 600' );
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"<?php if ( is_rtl() ) echo ' dir="rtl"'; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php _e( 'Maintenance' ); ?></title>
</head>
<body>
<h1><?php _e( 'Briefly unavailable for scheduled maintenance. Check back in a minute.' ); ?></h1>
</body>
</html>
<?php
die();
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- PHPXRef 0.7 : WordPress : Function Reference: wp_maintenance()
Function and Method Cross Reference. wp_maintenance(). Defined at: /wp- includes/load.php -> line 131. Referenced 1 times: /wp-settings.php -> line 52 ...
phpxref.ftwr.co.uk - WordPress › WP Maintenance Mode « WordPress Plugins
Apr 24, 2012 ... WP Maintenance Mode. Adds a splash page to your site that lets visitors know your site is down for maintenance. Full access to the back- ...
wordpress.org - Function Reference/wp maintenance « WordPress Codex
Description. Dies with a maintenance message when conditions are met. Checks for a file in the WordPress root directory named ".maintenance". This file will ...
codex.wordpress.org - WordPress › Maintenance Mode « WordPress Plugins
Oct 27, 2010 ... Adds a splash page to your blog that lets visitors know your blog is down for maintenance. Logged in administrators get full access to the blog ...
wordpress.org