Closed smargovsky closed 8 years ago
Any reason you haven't done something like this already?
These two plugins are basically ports of the Drupal modules that do more-or-less the same job. It's tricky (and somewhat arbitrary) deciding what to sync with what, so I thought that the barriers to migration from Drupal to WordPress would be lower if Drupal/CiviCRM developers could see how quick it was to port their favourite functionality to WordPress. It hasn't led to the deluge of WordPress/CiviCRM plugins that I thought it might, but there we are.
Any advice from your experience with both plugins to help a developer on their way?
I'd use BP Groups CiviCRM Sync as a starting point. You can then use the following hooks to achieve your aim (though I'd recommend capabilities rather than roles):
bp_groups_civicrm_sync_member_created
to assign role/caps to a userbp_groups_civicrm_sync_member_deleted
to remove role/caps from a userYou could be more granular about the role or capabilities assigned to a user if you map their group role to one or more WordPress capabilities. You would then use bp_groups_civicrm_sync_member_demoted
and bp_groups_civicrm_sync_member_promoted
and the usual suite of BuddyPress group-related hooks to tweak the caps.
Having said that, why assign a role or caps if you already have the information about a user's BuddyPress group membership? You can simply poll groups_is_user_member()
, groups_is_user_mod()
and groups_is_user_admin()
to retrieve essentially the same information. Are there plugins you use (or want to use) that work with purely with caps? If so, it would make sense to look at the way this plugin interfaces with the Groups plugin and amend that to your needs.
Thank you for the response. To clarify - I am not interested in using Buddy Press at all on this project. Just a vanilla CiviCRM Groups to Wordpress Capabilities / Roles sync.
I'm curious what you have against using BuddyPress which I think is highly useful in many respects. However, if you prefer to avoid it, you could roll your specific implementation from the relevant Civi hooks and the role/caps code in this plugin.
Hello,
I'm investigating syncing between Civi Contact Groups and Wordpress Roles / Capabilities. Your plugin that syncs Civi Groups to BuddyPress Groups seems to do half the work and this plugin the other half.
Any advice from your experience with both plugins to help a developer on their way?
Any reason you haven't done something like this already?
Thanks for your time in this regard, and the work on both of these plugins!