Definition:
function require_wp_db() {}
Load the correct database class file.
This function is used to load the database class file either at runtime or by wp-admin/setup-config.php. We must globalize $wpdb to ensure that it is defined globally by the inline code in wp-db.php.
Source code
function require_wp_db() {
global $wpdb;
require_once( ABSPATH . WPINC . '/wp-db.php' );
if ( file_exists( WP_CONTENT_DIR . '/db.php' ) )
require_once( WP_CONTENT_DIR . '/db.php' );
if ( isset( $wpdb ) )
return;
$wpdb = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST );
}
10212

February 24, 2011 


No comments yet... Be the first to leave a reply!