Skip to content

Media: Make client-side supported MIME types configurable#11277

Open
adamsilverstein wants to merge 1 commit intoWordPress:trunkfrom
adamsilverstein:add/client-side-supported-mime-types
Open

Media: Make client-side supported MIME types configurable#11277
adamsilverstein wants to merge 1 commit intoWordPress:trunkfrom
adamsilverstein:add/client-side-supported-mime-types

Conversation

@adamsilverstein
Copy link
Member

@adamsilverstein adamsilverstein commented Mar 17, 2026

Summary

Add a client_side_supported_mime_types filter and REST API index field so plugins can customize which image formats are processed client-side via WebAssembly-based vips.

  • Adds client_side_supported_mime_types filter with default list: image/jpeg, image/png, image/gif, image/webp, image/avif
  • Exposes the filtered value in the REST API root index response (for users with upload_files capability)
  • Updates preload paths in both post editor and site editor to include the new field

Changes

  • src/wp-includes/rest-api/class-wp-rest-server.php — Add filter and REST index field
  • src/wp-admin/edit-form-blocks.php — Add field to preload paths
  • src/wp-admin/site-editor.php — Add field to preload paths
  • tests/qunit/fixtures/wp-api-generated.js — Update test fixture

Related

Trac ticket: https://core.trac.wordpress.org/ticket/64876

Add a `client_side_supported_mime_types` filter and REST API
index field so plugins can customize which image formats are
processed client-side via WebAssembly-based vips.

The default list includes JPEG, PNG, GIF, WebP, and AVIF.

Also updates the preload paths in the post editor and site
editor to include the new field, ensuring the preloaded URL
matches the JavaScript request.

Props adamsilverstein.

See WordPress/gutenberg#76549.
@github-actions
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props adamsilverstein.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant