| 开发者 | jainanda |
|---|---|
| 更新时间 | 2026年11月4日 11:49 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
gold)administratoreditorauthorcontributorcustomer (WooCommerce)subscribersubscriber) as normal. Protection just means that role, once held, can never be stripped again afterwards.
For the same reason, a protected role can't be chosen as a membership level's role: members would keep it after their membership ended. If a level already uses one, the plugin shows a warning naming that level.
You can add additional protected roles via filter:
add_filter('pmpro_protected_roles', function($roles) { $roles[] = 'shop_manager'; return $roles; });
Requirements
slnwp-role-extension-pmpro folder to /wp-content/plugins/No — this plugin is a complete replacement. The official add-on must be deactivated to avoid conflicts. This plugin will show a warning in the admin if it detects the official add-on is still active.
Yes — this is a core feature. If you offer Gold Monthly (Level 1), Gold Quarterly (Level 2), and Gold Annual (Level 3), simply choose the gold role for all three levels. Members will be assigned the gold role regardless of which payment plan they chose.
The membership role is removed. If the user has no other active memberships, they are reset to the default WordPress role (usually subscriber). Protected roles such as administrator are never touched.
Both roles are handled correctly. The membership role is assigned and removed as normal, while the admin role is always preserved. This was a key bug in the official add-on that this plugin fixes.
Go to Memberships → Role Sync and click Run Sync Now. This is safe to run at any time.
Add a filter to your theme's functions.php:
add_filter('pmpro_protected_roles', function($roles) { $roles[] = 'shop_manager'; return $roles; });
administratoreditorauthorcontributorcustomer (WooCommerce)subscriberYes. Protection only blocks removal — a member who loses their last active membership is still reset to the site's default role (usually subscriber) exactly as before. Protecting it just means that once assigned, it can never be stripped again afterwards, the same as every other protected role.
Yes — the customer role is in the protected list by default so WooCommerce customers are never affected by membership role changes.