[wp-trac] [WordPress Trac] #64677: Client-Side Media: Move `image_editor_output_format` filtering to the upload response
WordPress Trac
noreply at wordpress.org
Fri Feb 20 16:11:19 UTC 2026
#64677: Client-Side Media: Move `image_editor_output_format` filtering to the
upload response
-----------------------------+-------------------------
Reporter: adamsilverstein | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 7.0
Component: Media | Version: trunk
Severity: normal | Keywords: needs-patch
Focuses: |
-----------------------------+-------------------------
In [https://github.com/WordPress/wordpress-develop/pull/10868 #10868]
(Editor: PHP backports for Client Side Media), the
`image_editor_output_format` filter is currently applied in the REST API
index (`get_index`) by iterating over a list of possible input MIME types
with an empty `$output_formats` array and no `$filename` parameter. As
noted in [https://github.com/WordPress/wordpress-
develop/pull/10868#discussion_r2831587138 this review comment], this
doesn't match how `wp_get_image_editor_output_format()` normally applies
the filter — it passes the actual filename and a pre-populated default
mapping.
== Problem ==
The current approach:
* Passes an empty array as the default value instead of the normal default
mapping
* Does not supply a `$filename` parameter to the filter
* Re-filters the same `$output_formats` variable across iterations,
accumulating results in a way that doesn't match the server-side behavior
* Is applied generically rather than per-upload, so plugins can't make
decisions based on the actual input file
== Proposed Solution ==
Move the `image_editor_output_format` logic from the REST API index
response into the '''initial image upload response'''. This is already the
pattern used for EXIF rotation data in client-side media processing.
Benefits:
* The actual input filename and MIME type will be available, so the filter
operates just like it does on the server side
* Plugins that hook into `image_editor_output_format` will receive
meaningful parameters
* Keeps per-file processing logic in the upload response where it belongs
== References ==
* PR: [https://github.com/WordPress/wordpress-develop/pull/10868 #10868]
* Review: [https://github.com/WordPress/wordpress-
develop/pull/10868#discussion_r2831587138 @westonruter's comment]
* Response: [https://github.com/WordPress/wordpress-
develop/pull/10868#discussion_r2832131664 @adamsilverstein's response]
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64677>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list