Skip to content
Snippets Groups Projects
Verified Commit 57b5c160 authored by Kevin Cristiano's avatar Kevin Cristiano :earth_americas:
Browse files

Fix Synchronize users for Multi-Site. Props Christian Wach

parent ece30b20
No related branches found
No related tags found
No related merge requests found
...@@ -767,11 +767,13 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { ...@@ -767,11 +767,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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment