Make WordPress Core

Opened 3 months ago

Closed 3 weeks ago

#65049 closed enhancement (fixed)

Templates: Add date field

Reported by: ntsekouras Owned by: ntsekouras
Priority: normal Milestone: 7.1
Component: REST API Version:
Severity: normal Keywords: has-patch has-unit-tests gutenberg-merge
Cc: Focuses:

Description

Backports: https://github.com/WordPress/gutenberg/pull/77134

This PR adds the date field in templates and template parts. This will help with the simplification of revisions handling for these post types, as there is a lot of scattered code around that working around the fact that they expose only the modified date.

## Testing Instructions

  1. date field should be returned through REST API
  2. everything should work exactly as before - especially the templates/template parts flows since the change affects only them.

Change History (3)

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


3 months ago
#1

  • Keywords has-unit-tests added

Backports: https://github.com/WordPress/gutenberg/pull/77134

Trac ticket: https://core.trac.wordpress.org/ticket/65049

This PR adds the date field in templates and template parts. This will help with the simplification of revisions handling for these post types, as there is a lot of scattered code around that working around the fact that they expose only the modified date.

## Testing Instructions

  1. date field should be returned through REST API
  2. everything should work exactly as before - especially the templates/template parts flows since the change affects only them.

#2 @wildworks
4 weeks ago

  • Keywords gutenberg-merge added

#3 @ntsekouras
3 weeks ago

  • Owner set to ntsekouras
  • Resolutionfixed
  • Status newclosed

In 62571:

Editor: Add a date field to templates and template parts.

Templates and template parts previously exposed only a modified date.
This adds a date property to the WP_Block_Template class, populated
from the post's publish date (post_date), and exposes it as a
read-only date field through the templates REST API controller.

Having the publish date available alongside modified simplifies
revisions handling for these post types, removing workarounds that
previously relied on the modified date alone.

Props ntsekouras, audrasjb, wildworks, mamaduka.
Fixes #65049.

Note: See TracTickets for help on using tickets.