From 3c98f0845362468b64e2a5fd6cfe9109150cd696 Mon Sep 17 00:00:00 2001 From: Kevin Locke Date: Wed, 3 Jun 2015 00:38:31 -0600 Subject: [PATCH] Define WP_USE_EXT_MYSQL for Wordpress 4 compatibility Wordpress 4 defaults to using mysqli_* functions in preference to mysql_*. Since pg4wp only provides replacements for mysql_ functions, we need to ensure that the mysql_* functions are called. Do this by defining WP_USE_EXT_MYSQL to true. Signed-off-by: Kevin Locke --- pg4wp/core.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pg4wp/core.php b/pg4wp/core.php index 990c13f..8422ad7 100644 --- a/pg4wp/core.php +++ b/pg4wp/core.php @@ -29,6 +29,8 @@ $replaces = array( ' '', '?>' => '', ); +// Ensure class uses the replaced mysql_ functions rather than mysqli_ +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