Make WordPress Core

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 ntsekouras)

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)

#1 @ntsekouras
14 hours ago

  • Owner set to ntsekouras

This ticket was mentioned in PR #12709 on WordPress/wordpress-develop by @ntsekouras.


14 hours ago
#2

  • Keywords has-patch has-unit-tests added

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

#3 @ntsekouras
10 hours ago

  • Description modified (diff)
  • Summary Fix template `date` return value for file templatesFix template `date` and `modified` return value for file templates

#4 @ntsekouras
10 hours ago

  • Description modified (diff)

#5 @ntsekouras
10 hours ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.