Adds an after-registration destination to the Student Registration block, extending its existing email-confirmation page setting rather than adding a second one.
The sidebar panel After email confirmation becomes After registration, and the page it selects gains a Redirect automatically toggle.
Behaviour
State
Result
Validation error / ?us_confirmed=expired
Error shown inline, never redirected past
"Check your email to confirm"
Message shown, never redirected past
Invited student, now logged in
Success message + "Continue to your account" link (new)
Email confirmed (ready / 1)
Success message + "Sign in to your account" link (unchanged)
Either of the last two, toggle on
Redirected to the chosen page instead of showing the link
Only those two finished states qualify — RegistrationPage::isRegistrationComplete(). The redirect itself runs from BlockRegistrar::maybeRedirectAfterRegistration() on template_redirect, since block rendering happens after output has started and is too late to send a Location header. The query-flag check runs before the post content is parsed, so an ordinary page view does not pay for a third block scan.
Judgement calls
No login-screen fallback for this redirect. Unlike the Booking block, with no page chosen nothing happens and the link shows as before. Sending an invited student who is already signed in to wp-login.php would be wrong, so continueUrl() (nullable) sits beside the existing loginUrl() (falls back to the login screen) and the two paths use whichever is right.
The invited-student success gains a link. It previously rendered a confirmation message with no link at all, so there was nothing for the toggle to replace.
Removed a now-provably-unreachable $successType === 'invite' branch from templates/frontend/register-page.php rather than leave a second, link-less copy of that markup to drift — render() returns before the template for logged-in visitors.
No schema change, so no version bump.
Tests
All run on the rebased branch:
composer test — 629 tests, 1808 assertions, OK
composer lint — PHPStan level 10, no errors
composer cs — PHPCS clean
New coverage: isRegistrationComplete() across all eight registration states, the invited-student link with and without a page chosen, continueUrl() with no resolvable page, and five BlockRegistrar auto-redirect cases (fires when finished; skipped when unfinished, not opted in, no page chosen, or pointing at its own page).
Adds an after-registration destination to the **Student Registration** block, extending its existing email-confirmation page setting rather than adding a second one.
The sidebar panel **After email confirmation** becomes **After registration**, and the page it selects gains a **Redirect automatically** toggle.
## Behaviour
| State | Result |
|---|---|
| Validation error / `?us_confirmed=expired` | Error shown inline, never redirected past |
| "Check your email to confirm" | Message shown, never redirected past |
| Invited student, now logged in | Success message + **"Continue to your account"** link (new) |
| Email confirmed (`ready` / `1`) | Success message + "Sign in to your account" link (unchanged) |
| Either of the last two, toggle on | Redirected to the chosen page instead of showing the link |
Only those two *finished* states qualify — `RegistrationPage::isRegistrationComplete()`. The redirect itself runs from `BlockRegistrar::maybeRedirectAfterRegistration()` on `template_redirect`, since block rendering happens after output has started and is too late to send a `Location` header. The query-flag check runs before the post content is parsed, so an ordinary page view does not pay for a third block scan.
## Judgement calls
- **No login-screen fallback for this redirect.** Unlike the Booking block, with no page chosen nothing happens and the link shows as before. Sending an invited student who is *already signed in* to `wp-login.php` would be wrong, so `continueUrl()` (nullable) sits beside the existing `loginUrl()` (falls back to the login screen) and the two paths use whichever is right.
- **The invited-student success gains a link.** It previously rendered a confirmation message with no link at all, so there was nothing for the toggle to replace.
- Removed a now-provably-unreachable `$successType === 'invite'` branch from `templates/frontend/register-page.php` rather than leave a second, link-less copy of that markup to drift — `render()` returns before the template for logged-in visitors.
No schema change, so no version bump.
## Tests
All run on the rebased branch:
- `composer test` — **629 tests, 1808 assertions, OK**
- `composer lint` — PHPStan level 10, no errors
- `composer cs` — PHPCS clean
New coverage: `isRegistrationComplete()` across all eight registration states, the invited-student link with and without a page chosen, `continueUrl()` with no resolvable page, and five `BlockRegistrar` auto-redirect cases (fires when finished; skipped when unfinished, not opted in, no page chosen, or pointing at its own page).
Closes #115
🤖 Generated with [Claude Code](https://claude.com/claude-code)
The Student Registration block's "After email confirmation" panel becomes
"After registration": the page it selects is now where a newly registered
student continues to, and a new autoRedirect toggle sends them there
instead of showing the link.
Only the two finished states qualify (RegistrationPage::isRegistrationComplete):
an invited student who is now logged in, and a self-signup back from the
emailed confirmation link. A validation error, an expired confirmation
link, and the intermediate "check your email" step all stay on the page so
their message is read.
The invited-student success previously had no link at all; it gains a
"Continue to your account" one. That path deliberately has no
WordPress-login-screen fallback — pointing someone already signed in at the
login screen helps nobody — so continueUrl() distinguishes "no page chosen"
from "page chosen", and the redirect does nothing until one is picked.
Closes#115
Co-Authored-By: Claude Opus 5 <[email protected]>
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.
Adds an after-registration destination to the Student Registration block, extending its existing email-confirmation page setting rather than adding a second one.
The sidebar panel After email confirmation becomes After registration, and the page it selects gains a Redirect automatically toggle.
Behaviour
?us_confirmed=expiredready/1)Only those two finished states qualify —
RegistrationPage::isRegistrationComplete(). The redirect itself runs fromBlockRegistrar::maybeRedirectAfterRegistration()ontemplate_redirect, since block rendering happens after output has started and is too late to send aLocationheader. The query-flag check runs before the post content is parsed, so an ordinary page view does not pay for a third block scan.Judgement calls
wp-login.phpwould be wrong, socontinueUrl()(nullable) sits beside the existingloginUrl()(falls back to the login screen) and the two paths use whichever is right.$successType === 'invite'branch fromtemplates/frontend/register-page.phprather than leave a second, link-less copy of that markup to drift —render()returns before the template for logged-in visitors.No schema change, so no version bump.
Tests
All run on the rebased branch:
composer test— 629 tests, 1808 assertions, OKcomposer lint— PHPStan level 10, no errorscomposer cs— PHPCS cleanNew coverage:
isRegistrationComplete()across all eight registration states, the invited-student link with and without a page chosen,continueUrl()with no resolvable page, and fiveBlockRegistrarauto-redirect cases (fires when finished; skipped when unfinished, not opted in, no page chosen, or pointing at its own page).Closes #115
🤖 Generated with Claude Code