dead_db ( No parameters )
- 定义位置
-
-
wp-includes/functions.php
, line 5307
-
wp-includes/functions.php
- 引入
- 2.3.2
- 弃用
- –
Loads custom DB error or display WordPress DB error.
If a file exists in the wp-content directory named db-error.php, then it will
be loaded instead of displaying the WordPress DB error. If it is not found,
then the WordPress DB error will be displayed instead.
The WordPress DB error sets the HTTP status header to 500 to try to prevent
search engines from caching the message. Custom DB messages should do the
same.
This function was backported to WordPress 2.3.2, but originally was added
in WordPress 2.5.0.
function dead_db() { global $wpdb; wp_load_translations_early(); // Load custom DB error template, if present. if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) { require_once WP_CONTENT_DIR . '/db-error.php'; die(); } // If installing or in the admin, provide the verbose message. if ( wp_installing() || defined( 'WP_ADMIN' ) ) { wp_die( $wpdb->error ); } // Otherwise, be terse. wp_die( '' . __( 'Error establishing a database connection' ) . '
', __( 'Database Error' ) ); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。