Opened 14 hours ago
Last modified 10 hours ago
#65728 assigned defect (bug)
Fix template `date` and `modified` return value for file templates
| Reported by: | ntsekouras | Owned by: | ntsekouras |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.1 |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
Description (last modified by )
Follow up of: https://core.trac.wordpress.org/ticket/65049
Will backport: https://github.com/WordPress/gutenberg/pull/80733
As noted here: https://github.com/WordPress/gutenberg/pull/77134#issuecomment-5044727859, the new date field for templates and template parts can return false for file templates.
In practice this doesn't cause any errors but still the returned value should match the declared type (string|null).
With that comment I realized that modified has the exact same problem for many versions (since 6.3). This ticket will also fix this.
We should update the type of modified to be the same with date to string|null and not return false for file templates.
Change History (5)
This ticket was mentioned in PR #12709 on WordPress/wordpress-develop by @ntsekouras.
14 hours ago
#2
- Keywords has-patch has-unit-tests added
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: https://core.trac.wordpress.org/ticket/65728
Follow up of: https://core.trac.wordpress.org/ticket/65049
As noted here: https://github.com/WordPress/gutenberg/pull/77134#issuecomment-5044727859, the new date field for templates and template parts can return false for file templates.
In practice this doesn't cause any errors but still the returned value should match the declared type (string|null).
## Use of AI Tools
Opus 5 with direction, changes and review