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 {
$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