WordPress.org

Make WordPress Core

Changeset 12827


Ignore:
Timestamp:
01/25/2010 10:09:43 PM (10 years ago)
Author:
ryan
Message:

Deprecate graceful_fail(). see #11644

Location:
trunk/wp-includes
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r12790 r12827  
    25052505 * @since 3.0.0
    25062506 * @private
    2507  * 
     2507 *
    25082508 * @param string $message Error message.
    25092509 * @param string $title Error title.
  • trunk/wp-includes/ms-deprecated.php

    r12733 r12827  
    5757}
    5858
     59if ( !function_exists('graceful_fail') ) :
     60/**
     61 * @deprecated 3.0
     62 */
     63function graceful_fail( $message ) {
     64    _deprecated_function( __FUNCTION__, '3.0', 'wp_die()' );
     65    $message = apply_filters('graceful_fail', $message);
     66    $message_template = apply_filters( 'graceful_fail_template',
     67'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     68<html xmlns="http://www.w3.org/1999/xhtml"><head profile="http://gmpg.org/xfn/11">
     69<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
     70<title>Error!</title>
     71<style type="text/css">
     72img {
     73    border: 0;
     74}
     75body {
     76line-height: 1.6em; font-family: Georgia, serif; width: 390px; margin: auto;
     77text-align: center;
     78}
     79.message {
     80    font-size: 22px;
     81    width: 350px;
     82    margin: auto;
     83}
     84</style>
     85</head>
     86<body>
     87<p class="message">%s</p>
     88</body>
     89</html>' );
     90    die( sprintf( $message_template, $message ) );
     91}
     92endif;
     93
    5994?>
  • trunk/wp-includes/ms-functions.php

    r12826 r12827  
    17671767}
    17681768
    1769 if ( !function_exists('graceful_fail') ) :
    1770 function graceful_fail( $message ) {
    1771     $message = apply_filters('graceful_fail', $message);
    1772     $message_template = apply_filters( 'graceful_fail_template',
    1773 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    1774 <html xmlns="http://www.w3.org/1999/xhtml"><head profile="http://gmpg.org/xfn/11">
    1775 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    1776 <title>Error!</title>
    1777 <style type="text/css">
    1778 img {
    1779     border: 0;
    1780 }
    1781 body {
    1782 line-height: 1.6em; font-family: Georgia, serif; width: 390px; margin: auto;
    1783 text-align: center;
    1784 }
    1785 .message {
    1786     font-size: 22px;
    1787     width: 350px;
    1788     margin: auto;
    1789 }
    1790 </style>
    1791 </head>
    1792 <body>
    1793 <p class="message">%s</p>
    1794 </body>
    1795 </html>' );
    1796     die( sprintf( $message_template, $message ) );
    1797 }
    1798 endif;
    1799 
    18001769/* Delete blog */
    18011770class delete_blog {
  • trunk/wp-includes/ms-load.php

    r12787 r12827  
    9292            } else {
    9393                    header('HTTP/1.1 410 Gone');
    94                     graceful_fail(__('This user has elected to delete their account and the content is no longer available.'));
     94                    wp_die(__('This user has elected to delete their account and the content is no longer available.'));
    9595            }
     96    } elseif ( '2' == $current_blog->deleted ) {
     97            if ( file_exists( WP_CONTENT_DIR . '/blog-inactive.php' ) )
     98                return WP_CONTENT_DIR . '/blog-inactive.php';
     99            else
     100                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}" ) ) ) );
    96101    }
    97102
    98     if ( '2' == $current_blog->deleted ) {
    99             if ( file_exists( WP_CONTENT_DIR . '/blog-inactive.php' ) ) {
    100                     return WP_CONTENT_DIR . '/blog-inactive.php';
    101             } else {
    102                     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}" ) ) ) );
    103             }
    104     }
    105 
    106     if( $current_blog->archived == '1' || $current_blog->spam == '1' ) {
     103    if ( $current_blog->archived == '1' || $current_blog->spam == '1' ) {
    107104            if ( file_exists( WP_CONTENT_DIR . '/blog-suspended.php' ) ) {
    108105                    return WP_CONTENT_DIR . '/blog-suspended.php';
    109106            } else {
    110107                    header('HTTP/1.1 410 Gone');
    111                     graceful_fail(__('This blog has been archived or suspended.'));
     108                    wp_die(__('This blog has been archived or suspended.'));
    112109            }
    113110    }
     111
    114112    return true;
    115113}
Note: See TracChangeset for help on using the changeset viewer.