function onUserAfterDelete($user, $succes, $msg) { $app = JFactory::getApplication(); // Instantiate CiviCRM require_once JPATH_ROOT . '/administrator/components/com_civicrm/civicrm.settings.php'; require_once 'CRM/Core/Config.php'; $config = CRM_Core_Config::singleton(); // Delete UFMatch CRM_Core_BAO_UFMatch::deleteUser($user['id']); }
/** * When a WordPress user is deleted, delete the ufMatch record * Callback function for 'delete_user' hook * * @param $user_id The numerical ID of the WordPress user * @return void */ public function delete_user_ufmatch($user_id) { if (!$this->civi->initialize()) { return; } // delete the ufMatch record require_once 'CRM/Core/BAO/UFMatch.php'; CRM_Core_BAO_UFMatch::deleteUser($user_id); }