Verified Commit 6c69cb3c authored by Kevin Cristiano's avatar Kevin Cristiano 🌎

Fix Synchronize users for Multi-Site. Props Christian Wach

Signed-off-by: Kevin Cristiano's avatarKevin Cristiano <kcristiano@kcristiano.com>
parent 9b906d44
...@@ -849,11 +849,13 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { ...@@ -849,11 +849,13 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
$contactCreated = 0; $contactCreated = 0;
$contactMatching = 0; $contactMatching = 0;
global $wpdb; // previously used $wpdb - which means WordPress *must* be bootstrapped
$wpUserIds = $wpdb->get_col("SELECT $wpdb->users.ID FROM $wpdb->users"); $wpUsers = get_users(array(
'blog_id' => get_current_blog_id(),
'number' => -1,
));
foreach ($wpUserIds as $wpUserId) { foreach ($wpUsers as $wpUserData) {
$wpUserData = get_userdata($wpUserId);
$contactCount++; $contactCount++;
if ($match = CRM_Core_BAO_UFMatch::synchronizeUFMatch($wpUserData, if ($match = CRM_Core_BAO_UFMatch::synchronizeUFMatch($wpUserData,
$wpUserData->$id, $wpUserData->$id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment