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 globalise $wpdb to ensure that it is defined globally by the inline code in wp-db.php.

Source code

function require_wp_db() {

	global $wpdb;

	if ( file_exists( WP_CONTENT_DIR . '/db.php' ) )

		require_once( WP_CONTENT_DIR . '/db.php' );

	else

		require_once( ABSPATH . WPINC . '/wp-db.php' );

}

2737

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 )

Connecting to %s

%d bloggers like this: