Advertisements

require_wp_db

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

Advertisements

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: