Verified Commit 0e0ed721 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 51739ec0
......@@ -838,11 +838,13 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base {
$contactCreated = 0;
$contactMatching = 0;
global $wpdb;
$wpUserIds = $wpdb->get_col("SELECT $wpdb->users.ID FROM $wpdb->users");
// previously used $wpdb - which means WordPress *must* be bootstrapped
$wpUsers = get_users(array(
'blog_id' => get_current_blog_id(),
'number' => -1,
));
foreach ($wpUserIds as $wpUserId) {
$wpUserData = get_userdata($wpUserId);
foreach ($wpUsers as $wpUserData) {
$contactCount++;
if ($match = CRM_Core_BAO_UFMatch::synchronizeUFMatch($wpUserData,
$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