#58540 closed enhancement (fixed)
Templates API: return post modified datetime in response
Reported by: | ramonopoly | Owned by: | isabel_brison |
---|---|---|---|
Milestone: | 6.3 | Priority: | normal |
Severity: | normal | Version: | 6.3 |
Component: | REST API | Keywords: | has-patch has-unit-tests gutenberg-merge add-to-field-guide |
Focuses: | Cc: |
Description (last modified by )
In order to display the latest modified date in the site editor for template and template parts we need to add modified
to the template and template part objects in the rest response for WP_REST_Templates_Controller
See https://github.com/WordPress/gutenberg/issues/49597 for reference to the designs and context.
For theme templates, it will add the modified value when we have a post id (which is once the template is first save after user change)
The modified property will be returned when a template is created, updated and fetched.
Gutenberg PR that introduced this change to the plugin:
Change History (12)
This ticket was mentioned in PR #4613 on WordPress/wordpress-develop by @ramonopoly.
15 months ago
#1
- Keywords has-patch has-unit-tests added
#2
@
15 months ago
- Keywords gutenberg-merge added
- Type changed from defect (bug) to enhancement
- Version set to trunk
#4
@
15 months ago
- Owner set to isabel_brison
- Resolution set to fixed
- Status changed from new to closed
In 55992:
This ticket was mentioned in PR #4680 on WordPress/wordpress-develop by @ramonopoly.
15 months ago
#6
In https://github.com/WordPress/wordpress-develop/pull/4613 tests were added to cover changes to _build_block_template_result_from_post
that reflect the new modified
property.
The wrong object was used in the template part assertion.
This commit corrects that and fixes the failing tests.
Trac ticket: https://core.trac.wordpress.org/ticket/58540
@ramonopoly commented on PR #4613:
15 months ago
#7
Sorry @tellthemachines and @TimothyBJacobs
I just realized I added a breaking change to PHP unit tests on this line
It'll cause the tests to fail sometimes (when they don't run fast enough 😄 )
Fix here:
@oandregal commented on PR #4680:
15 months ago
#9
Committed in https://core.trac.wordpress.org/changeset/55993.
WIP
Adding 'modified' field and value (if available) to template rest APIcontroller
Synching Core with:
Trac ticket: https://core.trac.wordpress.org/ticket/58540