From fe1e7958b1b140c32ee7d5853ed419ec47a85544 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Tue, 24 Jun 2014 18:28:56 +0530 Subject: [PATCH] CRM-14880 --- CRM/Utils/System/WordPress.php | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; } -- 2.25.1