Deprecate graceful_fail(). see #11644
git-svn-id: https://develop.svn.wordpress.org/trunk@12827 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d33c4ae2ca
commit
15e5d91692
@ -2504,7 +2504,7 @@ function wp_die( $message, $title = '', $args = array() ) {
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @private
|
||||
*
|
||||
*
|
||||
* @param string $message Error message.
|
||||
* @param string $title Error title.
|
||||
* @param string|array $args Optional arguements to control behaviour.
|
||||
|
@ -56,4 +56,39 @@ function is_site_admin( $user_login = '' ) {
|
||||
return is_super_admin( $user_id );
|
||||
}
|
||||
|
||||
if ( !function_exists('graceful_fail') ) :
|
||||
/**
|
||||
* @deprecated 3.0
|
||||
*/
|
||||
function graceful_fail( $message ) {
|
||||
_deprecated_function( __FUNCTION__, '3.0', 'wp_die()' );
|
||||
$message = apply_filters('graceful_fail', $message);
|
||||
$message_template = apply_filters( 'graceful_fail_template',
|
||||
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head profile="http://gmpg.org/xfn/11">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>Error!</title>
|
||||
<style type="text/css">
|
||||
img {
|
||||
border: 0;
|
||||
}
|
||||
body {
|
||||
line-height: 1.6em; font-family: Georgia, serif; width: 390px; margin: auto;
|
||||
text-align: center;
|
||||
}
|
||||
.message {
|
||||
font-size: 22px;
|
||||
width: 350px;
|
||||
margin: auto;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p class="message">%s</p>
|
||||
</body>
|
||||
</html>' );
|
||||
die( sprintf( $message_template, $message ) );
|
||||
}
|
||||
endif;
|
||||
|
||||
?>
|
@ -1766,37 +1766,6 @@ function fix_import_form_size( $size ) {
|
||||
return $size; // default
|
||||
}
|
||||
|
||||
if ( !function_exists('graceful_fail') ) :
|
||||
function graceful_fail( $message ) {
|
||||
$message = apply_filters('graceful_fail', $message);
|
||||
$message_template = apply_filters( 'graceful_fail_template',
|
||||
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head profile="http://gmpg.org/xfn/11">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<title>Error!</title>
|
||||
<style type="text/css">
|
||||
img {
|
||||
border: 0;
|
||||
}
|
||||
body {
|
||||
line-height: 1.6em; font-family: Georgia, serif; width: 390px; margin: auto;
|
||||
text-align: center;
|
||||
}
|
||||
.message {
|
||||
font-size: 22px;
|
||||
width: 350px;
|
||||
margin: auto;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p class="message">%s</p>
|
||||
</body>
|
||||
</html>' );
|
||||
die( sprintf( $message_template, $message ) );
|
||||
}
|
||||
endif;
|
||||
|
||||
/* Delete blog */
|
||||
class delete_blog {
|
||||
function delete_blog() {
|
||||
|
@ -91,26 +91,24 @@ function ms_site_check() {
|
||||
return WP_CONTENT_DIR . '/blog-deleted.php';
|
||||
} else {
|
||||
header('HTTP/1.1 410 Gone');
|
||||
graceful_fail(__('This user has elected to delete their account and the content is no longer available.'));
|
||||
wp_die(__('This user has elected to delete their account and the content is no longer available.'));
|
||||
}
|
||||
} elseif ( '2' == $current_blog->deleted ) {
|
||||
if ( file_exists( WP_CONTENT_DIR . '/blog-inactive.php' ) )
|
||||
return WP_CONTENT_DIR . '/blog-inactive.php';
|
||||
else
|
||||
wp_die( sprintf( __( 'This blog has not been activated yet. If you are having problems activating your blog, please contact <a href="mailto:%1$s">%1$s</a>.' ), str_replace( '@', ' AT ', get_site_option( 'admin_email', "support@{$current_site->domain}" ) ) ) );
|
||||
}
|
||||
|
||||
if ( '2' == $current_blog->deleted ) {
|
||||
if ( file_exists( WP_CONTENT_DIR . '/blog-inactive.php' ) ) {
|
||||
return WP_CONTENT_DIR . '/blog-inactive.php';
|
||||
} else {
|
||||
graceful_fail( sprintf( __( 'This blog has not been activated yet. If you are having problems activating your blog, please contact <a href="mailto:%1$s">%1$s</a>.' ), str_replace( '@', ' AT ', get_site_option( 'admin_email', "support@{$current_site->domain}" ) ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
if( $current_blog->archived == '1' || $current_blog->spam == '1' ) {
|
||||
if ( $current_blog->archived == '1' || $current_blog->spam == '1' ) {
|
||||
if ( file_exists( WP_CONTENT_DIR . '/blog-suspended.php' ) ) {
|
||||
return WP_CONTENT_DIR . '/blog-suspended.php';
|
||||
} else {
|
||||
header('HTTP/1.1 410 Gone');
|
||||
graceful_fail(__('This blog has been archived or suspended.'));
|
||||
wp_die(__('This blog has been archived or suspended.'));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user