FREE block. Allows the creator of an action to assign their action to a team.

Why use this
In campaigns with a team structure, individual fundraisers need a way to join a team. This block provides the form to select and save a team assignment.
What it does
The block shows a Select2 dropdown listing all available get_fund_team posts. When the creator submits the form, their action’s _get_fund_team_id meta is updated. Once a team assignment is saved, it is locked. The creator cannot change it again through this block. Only a user with edit_others_posts capability can change an assignment after it is set.
The block is intended for single action pages. It does not support Query Loop context.
Form submission uses a POST request handled at template_redirect, protected by a nonce (get_fund_assign_team_{post_id}).
How to use it
- Add the Group Assignment block to the action page template.
- The block automatically shows the team selector to the action’s creator.
- Once submitted, the assigned team is shown and the form is locked.
Settings and options
| Option | Type | Default | Description |
|---|---|---|---|
| Show group info | boolean | true | Show the current assignment info panel |
| Button text | string | Update Team Assignment | Submit button label |
| Button color | string | #4a9d44 | Button background |
| Button text color | string | #ffffff | Button text color |
| Button hover color | string | #d32f4a | Button hover background |
| Border radius | number | 6 | Button corner rounding |
| Text weight | string | 600 | Button font weight |
What you can and cannot do
- Once a team is assigned, the assignment is permanent from the creator’s perspective. Only admins can change it.
- The block is only actionable for the action’s creator. Other visitors see no form.
- The block does not support Query Loop context.
- Teams (
get_fund_teamCPT) must be created in the admin before they appear in the dropdown.
Troubleshooting
Dropdown is empty: No teams have been created. Create teams in Fundations > Teams in the WordPress admin.
Form appears to non-creators: Check that the action’s _get_fund_creator_id meta is set correctly. If it is empty, the creator check may fall back to post_author.