Opened 5 weeks ago
Last modified 3 weeks ago
#52840 accepted enhancement
Include filesize information in REST API response for all media types
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | REST API | Keywords: | has-patch needs-unit-tests |
Focuses: | rest-api | Cc: |
Description
Requesting the /media
REST API endpoint, only audio attachments include filesize information in the response data (in media_details->filesize
).
I suggest to check for each item if filesize
is present, or else fill it in using the actual file. This would be pretty much in line with what is done in wp_prepare_attachment_for_js.
Making the information available locally, when creating the response data, is much more performant than having to request the file in one or more follow-up requests.
Attachments (2)
Change History (3)
Note: See
TracTickets for help on using
tickets.
Formatting