A WordPress-centric search engine for devs and theme authors



require_wp_db ›

Since2.5.0
Deprecatedn/a
require_wp_db ( No parameters )
Defined at:
Codex:

Load the database class file and instantiate the `$wpdb` global.



Source

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 );
}