'// define( ', 'class wpdb' => 'class wpdb2', 'new wpdb' => 'new wpdb2', 'mysql_' => 'wpsql_', 'is_resource' => 'wpsql_is_resource', ' '', '?>' => '', ); // Ensure class uses the replaced mysql_ functions rather than mysqli_ if (!defined('WP_USE_EXT_MYSQL')) { define('WP_USE_EXT_MYSQL', true); } if (WP_USE_EXT_MYSQL != true) { throw new \Exception("PG4SQL CANNOT BE ENABLED WITH MYSQLI, REMOVE ANY WP_USE_EXT_MYSQL configuration"); } eval(str_replace(array_keys($replaces), array_values($replaces), file_get_contents(ABSPATH . '/wp-includes/class-wpdb.php'))); // Create wpdb object if not already done if (!isset($wpdb) && defined('DB_USER')) { $wpdb = new wpdb2(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST); }