humanmade / humanmade/amf-wordpress
Add a file size field to the REST API and use its value when fetching media
Open
enhancement
- Dominant language
- PHP
- Stars
- 51
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
This is a follow-up to #6.
The file size is not exposed by default in the WordPress REST API `media` endpoint. This plugin should add a new field to the REST API which exposes it, and then reads that value in `Factory::create()` and sets the file size via `$item->set_file_size()` if the field exists.
This would solve the problem of not having file size information when this plugin is used for sharing media within a Multisite network.
Longer term, we should open a ticket for WordPress core to get the file size added to the REST API too.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.