2

I have a WordPress site which is already using the CiviCRM WordPress Member Sync plugin to sync memberships to roles.

On this same site, I also want to show/hide certain content based on the user's having a membership of any type, age, or status -- basically, if they've ever had a membership, WP should use that fact to show/hide some content.

This show/hide should be possible with roles, capabilities, or groups, but I can't yet find a way to sync this "ever been a member" status to one of those. It seems like it requires a smart group in CiviCRM, and then I don't see any existing plugins that support syncing smart groups to roles, capabilities or groups.

Also, we need to continue using CiviCRM WordPress Member Sync for its current usage, and it doesn't seem to support additional sync rules beyond "one rule per membership type" and "only sync to roles, groups OR capabilities, but not to any combination of those."

Is there a plugin or combination of plugins that will allow this to be done? Or does this need a custom-built plugin?

2
  • 1
    I've been asked to merge CiviCRM WP Profile Sync, CiviCRM WP Member Sync, BP Groups CiviCRM Sync (and CiviCRM Groups Sync) into a monolithic sync plugin at various points but my feeling is that they are better kept separate. Andy's answer seems the way to go in your case. Feb 25, 2020 at 10:33
  • I strongly favor keeping them separate.
    – Andy Burns
    Feb 25, 2020 at 15:40

1 Answer 1

5

I would move to using groups and not roles for permissioning because it gives you more flexibility. People can be in multiple groups then.

There is the CiviCRM Groups Sync which syncs a regular CiviCRM group to a WP group. So that may be an option by auto-adding members to the CiviCRM group and creating their WP user at the form-level.

The other option is to improve the plugin by having it sync smart groups.

5
  • It sounds like @TwoMice probably has the WordPress users from their historic Memberships -- so CiviCRM Groups Sync should be just the ticket. Feb 25, 2020 at 10:35
  • 1
    CiviCRM Group Sync doesn't support smart groups (right Christian?), but I'm pretty sure I can 1) create a regular group "ever members" in civicrm, linked to a WP group 2) pre-load all contacts who've ever had a membership into that group, 3) configure civirules to add the contact to that group whenever a new membership is created. I.e., because no-one will ever leave this group, it doesn't really need to be a smart group at all. Thanks for throwing around ideas, Andy and Christian.
    – TwoMice
    Feb 25, 2020 at 14:57
  • Hmm, dang it @TwoMice you're right of course - my memory's failing me. I should put that on a todo list for CiviCRM Groups Sync - given that Smart Groups have an admin UI once created, that would be possible. But yeah, your CiviRules approach would work right now. Feb 25, 2020 at 16:16
  • Okay, OTOH Smart Groups can't be of type "Access Control" so perhaps I'll scratch that todo item. Feb 25, 2020 at 16:25
  • 1
    Having used Drupal CiviGroups Role Sync, this all seems like a really complicated way to do something that should be really dead simple. Pick a CiviCRM Group, pick a WordPress role, and tell the sync tool to keep them, well, synced. Let the CMS do what it does best - maintain the user roles and permissions - and let the CRM do what it does best - organize contacts. And while it would be nice if the sync tool could sync to smart groups, and I would welcome it, that's not the priority in my opinion. Having a simple tool to sync THIS group to THIS role would be awesome.
    – guyiac
    Nov 28, 2022 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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