From 2fc28e9bd8ae5beff3d48a70e19e5aa9078e70d2 Mon Sep 17 00:00:00 2001 From: Kevin Locke Date: Thu, 30 Jun 2016 15:37:14 -0700 Subject: [PATCH] Only instantiate when DB_USER is defined During setup, before wp-content.php is created and DB_USER is defined, there is no way to instantiate it meaningfully. Signed-off-by: Kevin Locke --- pg4wp/core.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pg4wp/core.php b/pg4wp/core.php index 8422ad7..72d2a75 100644 --- a/pg4wp/core.php +++ b/pg4wp/core.php @@ -34,5 +34,5 @@ define( 'WP_USE_EXT_MYSQL', true); eval( str_replace( array_keys($replaces), array_values($replaces), file_get_contents(ABSPATH.'/wp-includes/wp-db.php'))); // Create wpdb object if not already done -if (! isset($wpdb)) +if (! isset($wpdb) && defined('DB_USER')) $wpdb = new wpdb2( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST );