函数原型
dead_db()
函数描述
Loads custom DB error or display WordPress DB error.
是否弃用
未弃用
函数参数
无
函数返回值
无
函数位置
File: wp-includes/functions.php.
函数源码
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( '<h1>' . __( 'Error establishing a database connection' ) . '</h1>', __( 'Database Error' ) );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.3.2 | Introduced. |

