Answers.Body: <p>I would move to using groups and not roles for permissioning because it gives you more flexibility. People can be in multiple groups then.</p>
  
  <p>There is the <a href="https://civicrm.org/blog/danaskallman/civicrm-groups-sync-plugin-for-wordpress" rel="noreferrer">CiviCRM Groups Sync</a> which syncs a regular CiviCRM group to a WP group. So that may be an option by <a href="https://docs.civicrm.org/user/en/latest/organising-your-data/profiles/#add-new-contacts-to-a-group" rel="noreferrer">auto-adding members to the CiviCRM group</a> and <a href="https://docs.civicrm.org/user/en/latest/organising-your-data/profiles/#wordpress-user-account-registration-option" rel="noreferrer">creating their WP user</a> at the form-level. </p>
  
  <p>The other option is to improve the plugin by having it sync smart groups.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-25T10:35:46.750Z
Answers.Text: It sounds like @TwoMice probably has the WordPress users from their historic Memberships -- so CiviCRM Groups Sync should be just the ticket.
Answers.UserDisplayName: Christian Wach
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-25T14:57:56.687Z
Answers.Text: 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.
Answers.UserDisplayName: TwoMice
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-25T16:16:25.620Z
Answers.Text: 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.
Answers.UserDisplayName: Christian Wach
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-25T16:25:43.453Z
Answers.Text: Okay, OTOH Smart Groups can't be of type "Access Control" so perhaps I'll scratch that todo item.
Answers.UserDisplayName: Christian Wach
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-11-28T17:40:32.117Z
Answers.Text: 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.
Answers.UserDisplayName: guyiac
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-24T21:51:32.043Z
Answers.LastActivityDate: 2020-02-24T22:01:38.663Z
Answers.LastEditDate: 2020-02-24T22:01:38.663Z
Answers.UserDisplayName: Andy Burns
Body: <p>I have a WordPress site which is already using the <em>CiviCRM WordPress Member Sync</em> plugin to sync memberships to roles. </p>
  
  <p>On this same site, I also want to <strong>show/hide certain content based on the user's having a membership of any type, age, or status</strong> -- basically, if they've <em>ever</em> had a membership, WP should use that fact to show/hide some content. </p>
  
  <p>This show/hide should be possible with roles, capabilities, or <a href="https://wordpress.org/plugins/groups/" rel="nofollow noreferrer">groups</a>, 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.</p>
  
  <p>Also, we need to continue using <em>CiviCRM WordPress Member Sync</em> 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."</p>
  
  <p>Is there a plugin or combination of plugins that will allow this to be done? Or does this need a custom-built plugin?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-25T10:33:02.257Z
Comments.Text: 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.
Comments.UserDisplayName: Christian Wach
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-25T15:40:56.323Z
Comments.Text: I strongly favor keeping them separate.
Comments.UserDisplayName: Andy Burns
Tags: <wordpress><civimember><smartgroups>
Title: Sync smart group to WordPress role, group, or capability
ThreadText: # Sync smart group to WordPress role, group, or capability
  
  (Asked by: username_0 on 2020-02-24)
  
  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](https://wordpress.org/plugins/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?
  
  **Tags:** wordpress, civimember, smartgroups
  
  > **Comments:**
  > **username_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.  
  > **username_2**: I strongly favor keeping them separate.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-02-24. Score: 5 | Accepted answer
  
  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](https://civicrm.org/blog/danaskallman/civicrm-groups-sync-plugin-for-wordpress) which syncs a regular CiviCRM group to a WP group. So that may be an option by [auto-adding members to the CiviCRM group](https://docs.civicrm.org/user/en/latest/organising-your-data/profiles/#add-new-contacts-to-a-group) and [creating their WP user](https://docs.civicrm.org/user/en/latest/organising-your-data/profiles/#wordpress-user-account-registration-option) at the form-level.
  
  The other option is to improve the plugin by having it sync smart groups.
  
  > **Comments:**
  > **username_1**: It sounds like @username_0 probably has the WordPress users from their historic Memberships -- so CiviCRM Groups Sync should be just the ticket.  
  > **username_0**: 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.  
  > **username_1**: Hmm, dang it @username_0 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.  
  > **username_1**: Okay, OTOH Smart Groups can't be of type "Access Control" so perhaps I'll scratch that todo item.  
  > **username_3**: 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.  
  
  ---
  
  