Opened 10 years ago
Closed 10 years ago
#35629 closed defect (bug) (fixed)
Fix link handling in WP_REST_Server->embed_links()
| Reported by: | danielbachhuber | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.5 |
| Component: | REST API | Version: | 4.4 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description (last modified by )
While fixing one bug, I ran into another.
- Convert WP_Error to WP_REST_Response in WP_REST_Server->embed_links(). Later on
WP_REST_Server->response_to_data()expects to always receiveWP_REST_Response. With the current code, aWP_Errorobject returned fromdispatch()inside ofembed_links()would fatal, becauseWP_Errordoesn't implement the same methods asWP_REST_Response - Properly support non-pretty permalink REST routes.
http://example.org/?rest_route=%2Ftest%2Ftest%2Fembeddable&error=1won't be embedded because it doesn't matchhttp://example.org/?rest_route=/
Attachments (1)
Change History (6)
This ticket was mentioned in Slack in #core-restapi by danielbachhuber. View the logs.
10 years ago
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Actually, the first item is a non-issue because
dispatch()always returnsWP_REST_Response.Attached is a patch to fix the second issue.