"civicrm_groups_sync_user_id_get_by_contact_id" filter: adding to or removing from group?
For the civicrm_groups_sync_user_id_get_by_contact_id
filter, it would be helpful to know whether the CiviCRM contact is being added to or removed from the group. For certain use cases, it would also be useful to know the group name.
When a contact is being removed from a group, it probably doesn't make sense to create the WordPress user if they do not yet exist.
In my case I'm also using this hook to execute some additional WordPress user initialization—adding the user to a specific role. This really should only be executed when the user is being added to a specific Civi/WordPress group— since the hook doesn't give me either the action (add or remove) or group name, what I'm implementing now is a bit of a hack. (I did a quick search for any other Civi hook when a contact is added to or removed from a group, but did not find one.)
Of course, adding parameters to the hook would break the method signature, creating compatibility issues. Any thoughts on how this capability could be implemented?