From: jitendrapurohit Date: Tue, 24 Jun 2014 12:58:56 +0000 (+0530) Subject: CRM-14880 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fe1e7958b1b140c32ee7d5853ed419ec47a85544;p=civicrm-core.git CRM-14880 --- diff --git a/CRM/Utils/System/WordPress.php b/CRM/Utils/System/WordPress.php index 78ad9f0d92..9e0048f21f 100644 --- a/CRM/Utils/System/WordPress.php +++ b/CRM/Utils/System/WordPress.php @@ -475,6 +475,16 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { date_default_timezone_set($wpUserTimezone); CRM_Core_Config::singleton()->userSystem->setMySQLTimeZone(); } + require_once ($cmsRootPath . DIRECTORY_SEPARATOR . 'wp-includes/pluggable.php'); + $uid = CRM_Utils_Array::value('uid', $name); + if ($uid) { + $account = wp_set_current_user($uid); + if ($account && $account->data->ID) { + global $user; + $user = $account; + return TRUE; + } + } return true; }