1

Christian Wach's excellent set of Wordpress plugins make that CMS viable for member's only sites - wouldn't work otherwise!

Here's the query. Using the "Roles" option as the synchronization option, a Wordpress user with the Wordpress user role being e.g. "Membership pending" signs up for a CiviCRM membership and via the plugin gets assigned to the Wordpress user role "Membership granted".

However, the Wordpress user now has two roles: "Membership pending" and "Membership granted".

The $64.000 question then is:

  • Is this by default, i.e. CiviCRM WordPress Member Sync does not switch Wordpress roles, but rather adds them, or
  • I do have the Member's plugin installed, with the multiple roles option not checked (although it had been in use previously), and I've now screwed up any forcing of only one user role per user until the end of time?

If latter condition is in fact false - any ideas of how to make (the plugin?) not add a role but in fact switch it?

Cheers!

  • Is "Membership pending" the default role? – Christian Wach Oct 23 '16 at 18:24
  • Yes - that's what the newly registered Wordpress user gets. BTW: I've implemented a sort of work-around by Setting up a CiviCRM Membership type that goes by the name "Pending acceptance", costs nothing and is for a lifetime. At the same time there now is a Membership status rule (OCD'ed "Pending acceptance") that has its start event set to "member since" and its end event set to "member since" -1 day adjustment (and is all the way at the top of the list, before new). That way the backoffice gives the newbie Membership type "Pending acceptance", which immediately expires, triggering your -> – Abteilung Gerontopsychiatrie Oct 24 '16 at 11:10
  • plugin to change the Wordpress user roles to "Membership granted". Now the newbie gets permission to view restricted Wordpress pages (by the Members plugin) to continue on with payment. Sounds complicated!? But is necessary because German law (and our bylaws)requires the board to approve membership (of a "Verein") - before somebody pays their dues, making it difficult to not have them be part of the party... If the plugin could "change" roles instead of adding them, then... Cheers – Abteilung Gerontopsychiatrie Oct 24 '16 at 11:15
  • The plugin removes the default role when a membership is updated: github.com/christianwach/civicrm-wp-member-sync/blob/master/… so if they have that, then the new role should replace it. There's a conundrum when multiple memberships exist - should the plugin add roles or replace them? Or keep track of a "role stack"? I would say that you have given the best description of why you should be using capabilities rather than roles! – Christian Wach Oct 24 '16 at 12:20
  • Well at least it was good for that ;) On the other hand: Wouldn't capabilities amount to a dichotomization - view the page when member, don't view if not? In my case I've got three levels: Anonymous, Membership pending (i.e. the registration process with details on B'day, Organization, etc.) I want to keep away from the public eye and Membership accepted with payment and private pages PLUS no longer be able to read "Membership pending" pages (just in case somebody gets lost and by chance lands there, screwing up the registration process). – Abteilung Gerontopsychiatrie Oct 24 '16 at 14:26
2

The CiviCRM WordPress Member Sync plugin provides basic sync functionality and does not necessarily cover all possible use cases. What I would do in your case is use the civi_wp_member_sync_add_role hook to capture which user is being assigned which role. You can then remove the "Membership pending" role and make sure they only have the "Membership granted" role.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.