DOCS

User roles

Fundations adds a custom WordPress user role called fund_member (displayed as “Fundraiser”). This role is assigned automatically when a new user account is created through the Action Wizard. This is a free feature.

Why use this

Fundraisers need just enough WordPress capability to manage their own fundraising pages. The fund_member role provides this without granting access to other WordPress admin areas.

What it does

The fund_member role

The fund_member role is based on subscriber capabilities with these additions:

CapabilityValue
readtrue
edit_get_fund_actionstrue
edit_published_get_fund_actionstrue
publish_get_fund_actionstrue
delete_get_fund_actionstrue

Administrator capabilities

On initialisation, the Administrator role automatically receives all four get_fund_* capabilities via add_admin_capabilities().

Legacy migration

On init, the plugin checks for users with the old p2p_member role (from a previous version of the plugin). Any such users are automatically migrated to fund_member and the old role is removed. This is a one-time background process.

Role name localisation

If the stored role display name differs from the current translation of “Fundraiser” (for example after a language change), the role name is updated in place.

Where the role is assigned

The role is assigned in two places. The Action Wizard’s get_or_create_user() creates the user with wp_create_user() and sets the role via wp_update_user(['role' => 'fund_member']). The block-based account form can also assign the role on registration.

How to use it

The role is managed automatically. No manual configuration is needed under normal circumstances.

To view or edit role assignments:

  1. Go to Users in the WordPress admin.
  2. Filter by the “Fundraiser” role using the role filter links above the list.
  3. Edit individual users to change their role.
Users list fundraiser role

What you can and cannot do

You can assign the fund_member role to existing users manually, grant additional capabilities to fund_member using a roles plugin (such as Members), and check for the role in custom code: current_user_can('edit_get_fund_actions').

You cannot remove the fund_member role while the Fundations plugin is active, because it is recreated on each plugin init. You also cannot prevent the wizard from assigning this role to new users without modifying the wizard code.

Troubleshooting

Newly created fundraisers cannot access the frontend edit form. Confirm the user has the fund_member role. If the wizard was run in guest mode, no user account was created. The creator must claim the action first.

Old users still showing the p2p_member role. The migration runs on init. If WordPress cron is stalled, visit any page on the site to trigger init and run the migration. Alternatively, run wp eval 'Get_Fund_User_Roles::maybe_migrate_legacy_roles();' via WP-CLI.

Administrators cannot manage fundraising pages. Confirm the administrator role has the get_fund_* capabilities. Deactivate and reactivate Fundations to re-run add_admin_capabilities().

Developer reference

No hooks are exposed by Get_Fund_User_Roles. Capability checks in other parts of the plugin use standard WordPress current_user_can() calls.

Capability reference

CapabilityUsed for
edit_get_fund_actionsEditing own fundraising pages
edit_published_get_fund_actionsEditing published (live) fundraising pages
publish_get_fund_actionsPublishing draft fundraising pages
delete_get_fund_actionsDeleting own fundraising pages
edit_others_postsEditing any user’s fundraising page (admin only)