Opened 9 years ago
Closed 9 years ago
#35629 closed defect (bug) (fixed)
Fix link handling in WP_REST_Server->embed_links()
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | 4.4 |
Component: | REST API | Keywords: | |
Focuses: | Cc: |
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_Error
object returned fromdispatch()
inside ofembed_links()
would fatal, becauseWP_Error
doesn't implement the same methods asWP_REST_Response
- Properly support non-pretty permalink REST routes.
http://example.org/?rest_route=%2Ftest%2Ftest%2Fembeddable&error=1
won'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.
9 years ago
Note: See
TracTickets for help on using
tickets.
Actually, the first item is a non-issue because
dispatch()
always returnsWP_REST_Response
.Attached is a patch to fix the second issue.