Make WordPress Core

Opened 7 weeks ago

Last modified 6 weeks ago

#61308 assigned enhancement

Return `post_types` field in templates REST API

Reported by: oandregal's profile oandregal Owned by: oandregal's profile oandregal
Milestone: 6.7 Priority: normal
Severity: normal Version:
Component: REST API Keywords: has-patch needs-unit-tests
Focuses: Cc:

Description

While working on the site editor templates screen, I realized we don't expose the post_types field through the templates endpoint https://developer.wordpress.org/rest-api/reference/wp_templates/, though it's one of the parameters consumers can use to query it.

In the dataviews-powered page, we want to expose this information so the user can filter templates that are intended to work with a given post type.

My suggestion is to expose this new field through the existing templates REST API endpoint.

Change History (4)

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


7 weeks ago
#1

  • Keywords has-patch added

#2 @oglekler
6 weeks ago

@spacedmonkey can you, please, take a look. I have doubts that we will be able to make in into 6.6, but it looks simple enough and quite reasonable to have. Thank you!

#3 @spacedmonkey
6 weeks ago

@oandregal can you add a unit test for this change.

#4 @oglekler
6 weeks ago

  • Keywords needs-unit-tests added
  • Milestone changed from 6.6 to 6.7

We have 3 hours until the commit freeze before Beta 1 release and no Unit tests. I am rescheduling it to the next milestone. Let's make it when Trunk will be open for enhancements again, without waiting for the last moment. Thank you 😅

Note: See TracTickets for help on using tickets.