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

Fix Synchronize users for Multi-Site. Props Christian Wach

parent 6b4185a2
No related branches found
No related tags found
No related merge requests found
......@@ -830,11 +830,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,
......
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