Make WordPress Core

Opened 8 weeks ago

Last modified 3 weeks ago

#49116 new enhancement

Add Links to the REST version of a Resource in the header of the page

Reported by: dshanske Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: REST API Keywords: needs-patch needs-unit-tests dev-feedback
Focuses: rest-api Cc:


Proposing as suggested by @timothybjacobs in Slack, that on each page, a link in the header of the HTML file to the REST route for that resource.

So, an author page would link to the user endpoint for that user. A post to the rest route to that specific post, etc.

The rel on the link to the REST API endpoint is rel="https://api.w.org/". This should probably be a rel="alternate" which indicates an alternative representation of the page, with type "application/json" as it is technically a json representation of the page, but this may need more discussion.

Change History (2)

#1 @TimothyBlynJacobs
8 weeks ago

I would agree that alternate makes sense for the relation. https://html.spec.whatwg.org/multipage/links.html#rel-alternate

#2 @dshanske
3 weeks ago

@TimothyBlynJacobs Do we want to try to get this in for the next release?

Note: See TracTickets for help on using tickets.