Change birth date to just birth year as part of registration
Current behaviour
A full Y-m-d date of birth is collected and stored in the us_date_of_birth user meta (src/Guardian/GuardianService.php — META_DOB, and the store/normalise helper around line 330). Rendered as <input type="date"> in templates/frontend/register-page.php (line 93) and templates/frontend/family-page.php (lines 45-46, 83), displayed in templates/admin/student-detail.php and templates/admin/students.php, and previewed in src/BlockPreview.php (line 194).
Wanted
Collect and display a birth year only — a 4-digit numeric input with a sane range.
Decisions to make
New meta key (e.g. us_birth_year) vs. reusing us_date_of_birth. A new key is cleaner; if so, decide whether existing DOB values get migrated to their year or just left in place.
Validation range (e.g. current year back to current year − 120).
Places to touch
src/Guardian/GuardianService.php — meta constant, normalisation, date_of_birth in the children list array
Stored in user meta, not a custom table — no Schema.php change and therefore no USC_VERSION bump needed. Confirm that when implementing.
## Feedback
> Change birth date to just birth year as part of registration
## Current behaviour
A full `Y-m-d` date of birth is collected and stored in the `us_date_of_birth` user meta (`src/Guardian/GuardianService.php` — `META_DOB`, and the store/normalise helper around line 330). Rendered as `<input type="date">` in `templates/frontend/register-page.php` (line 93) and `templates/frontend/family-page.php` (lines 45-46, 83), displayed in `templates/admin/student-detail.php` and `templates/admin/students.php`, and previewed in `src/BlockPreview.php` (line 194).
## Wanted
Collect and display a birth **year** only — a 4-digit numeric input with a sane range.
## Decisions to make
- New meta key (e.g. `us_birth_year`) vs. reusing `us_date_of_birth`. A new key is cleaner; if so, decide whether existing DOB values get migrated to their year or just left in place.
- Validation range (e.g. current year back to current year − 120).
## Places to touch
- `src/Guardian/GuardianService.php` — meta constant, normalisation, `date_of_birth` in the children list array
- `templates/frontend/register-page.php`, `templates/frontend/family-page.php`
- `templates/admin/student-detail.php`, `templates/admin/students.php`
- `src/BlockPreview.php`
- `docs/features/parent-guardian-accounts.md`, `docs/features/account-registration.md`
- `tests/Unit/Guardian/GuardianServiceTest.php`, `GuardianRepositoryTest.php`, `FamilyPageTest.php`
## Note
Stored in user meta, not a custom table — no `Schema.php` change and therefore no `USC_VERSION` bump needed. Confirm that when implementing.
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.
Feedback
Current behaviour
A full
Y-m-ddate of birth is collected and stored in theus_date_of_birthuser meta (src/Guardian/GuardianService.php—META_DOB, and the store/normalise helper around line 330). Rendered as<input type="date">intemplates/frontend/register-page.php(line 93) andtemplates/frontend/family-page.php(lines 45-46, 83), displayed intemplates/admin/student-detail.phpandtemplates/admin/students.php, and previewed insrc/BlockPreview.php(line 194).Wanted
Collect and display a birth year only — a 4-digit numeric input with a sane range.
Decisions to make
us_birth_year) vs. reusingus_date_of_birth. A new key is cleaner; if so, decide whether existing DOB values get migrated to their year or just left in place.Places to touch
src/Guardian/GuardianService.php— meta constant, normalisation,date_of_birthin the children list arraytemplates/frontend/register-page.php,templates/frontend/family-page.phptemplates/admin/student-detail.php,templates/admin/students.phpsrc/BlockPreview.phpdocs/features/parent-guardian-accounts.md,docs/features/account-registration.mdtests/Unit/Guardian/GuardianServiceTest.php,GuardianRepositoryTest.php,FamilyPageTest.phpNote
Stored in user meta, not a custom table — no
Schema.phpchange and therefore noUSC_VERSIONbump needed. Confirm that when implementing.