mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
Deprecate graceful_fail(). see #11644
git-svn-id: http://svn.automattic.com/wordpress/trunk@12827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
63f9a62af6
commit
b090a0336f
@ -2504,7 +2504,7 @@ function wp_die( $message, $title = '', $args = array() ) {
|
|||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
* @private
|
* @private
|
||||||
*
|
*
|
||||||
* @param string $message Error message.
|
* @param string $message Error message.
|
||||||
* @param string $title Error title.
|
* @param string $title Error title.
|
||||||
* @param string|array $args Optional arguements to control behaviour.
|
* @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 );
|
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
|
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 */
|
/* Delete blog */
|
||||||
class delete_blog {
|
class delete_blog {
|
||||||
function delete_blog() {
|
function delete_blog() {
|
||||||
|
@ -91,26 +91,24 @@ function ms_site_check() {
|
|||||||
return WP_CONTENT_DIR . '/blog-deleted.php';
|
return WP_CONTENT_DIR . '/blog-deleted.php';
|
||||||
} else {
|
} else {
|
||||||
header('HTTP/1.1 410 Gone');
|
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 ( $current_blog->archived == '1' || $current_blog->spam == '1' ) {
|
||||||
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 ( file_exists( WP_CONTENT_DIR . '/blog-suspended.php' ) ) {
|
if ( file_exists( WP_CONTENT_DIR . '/blog-suspended.php' ) ) {
|
||||||
return WP_CONTENT_DIR . '/blog-suspended.php';
|
return WP_CONTENT_DIR . '/blog-suspended.php';
|
||||||
} else {
|
} else {
|
||||||
header('HTTP/1.1 410 Gone');
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user