Follow-up to #16 (account registration, #18): make invitation links land on the right page.
Changes
Registration Page selector on the Invites admin page (wp_dropdown_pages), stored in the us_registration_page_id option. Invitation links point at the selected page (get_permalink), falling back to the home page when unset (with a warning notice).
Auto-redirect (RegistrationPage::maybeRedirectToRegistrationPage(), hooked on template_redirect): any front-end request carrying a us_invite token is redirected to the configured registration page (token preserved) unless already there — so links generated/shared before a page was selected still work. No-op when no page is set.
Button rename: the invite button now reads "Generate Invitation Link" (was "Send Invite").
RegistrationController gained the OPTION_PAGE constant and a set_page action. Doc updated.
Verification
composer test (104 tests), composer cs, PHPStan level 6, and the no-debug check all pass.
Follow-up to #16 (account registration, #18): make invitation links land on the right page.
## Changes
1. **Registration Page selector** on the **Invites** admin page (`wp_dropdown_pages`), stored in the `us_registration_page_id` option. Invitation links point at the selected page (`get_permalink`), falling back to the home page when unset (with a warning notice).
2. **Auto-redirect** (`RegistrationPage::maybeRedirectToRegistrationPage()`, hooked on `template_redirect`): any front-end request carrying a `us_invite` token is redirected to the configured registration page (token preserved) unless already there — so links generated/shared *before* a page was selected still work. No-op when no page is set.
3. **Button rename**: the invite button now reads **"Generate Invitation Link"** (was "Send Invite").
`RegistrationController` gained the `OPTION_PAGE` constant and a `set_page` action. Doc updated.
## Verification
`composer test` (104 tests), `composer cs`, PHPStan level 6, and the no-debug check all pass.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Invitation links previously pointed at the site home page, which usually
does not host the [us_student_register] shortcode. Let the studio admin
choose the registration page (stored in the us_registration_page_id
option); invitation links now point there, falling back to the home page
when unset (with a warning notice).
- RegistrationController: OPTION_PAGE constant; set_page action; pass the
page id/url to the template.
- templates/admin/invites.php: wp_dropdown_pages selector + save; build the
invite link from the selected page.
- Doc updated.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
- RegistrationPage::maybeRedirectToRegistrationPage() (hooked on
template_redirect): any front-end request carrying a us_invite token is
redirected to the configured registration page (token preserved), unless
already there. Covers links shared before a page was selected; no-op when
no page is set.
- Invites button text: "Send Invite" -> "Generate Invitation Link".
- Doc updated.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
thatguygriff
changed title from Add registration-page selector to the Invites page to Invite links: page selector + auto-redirect for stray tokens2026-06-07 13:31:30 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Follow-up to #16 (account registration, #18): make invitation links land on the right page.
Changes
wp_dropdown_pages), stored in theus_registration_page_idoption. Invitation links point at the selected page (get_permalink), falling back to the home page when unset (with a warning notice).RegistrationPage::maybeRedirectToRegistrationPage(), hooked ontemplate_redirect): any front-end request carrying aus_invitetoken is redirected to the configured registration page (token preserved) unless already there — so links generated/shared before a page was selected still work. No-op when no page is set.RegistrationControllergained theOPTION_PAGEconstant and aset_pageaction. Doc updated.Verification
composer test(104 tests),composer cs, PHPStan level 6, and the no-debug check all pass.🤖 Generated with Claude Code
Add registration-page selector to the Invites pageto Invite links: page selector + auto-redirect for stray tokens