humanmade / humanmade/tachyon-plugin

Block editor uses `view` context causing REST API override to fail.

Open
#84 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
86
Forks
16
PR merge metrics
No merged PRs in 30d

Description

The WordPress block editor now requests the media endpoint using the `view` context.

The `should_rest_image_downsize` method in Tachyon needs to be updated to account for this as Tachyon URLs are now used in the block editor regardless of the `tachyon_disable_in_admin` filter's return value.

Tachyon will need to update the REST API override to use wp.apiFetch middleware similar to the [code used in Photon](https://github.com/Automattic/jetpack/blob/6e406d07f4bc9acbd72a89e8dd236b07d803fdae/projects/packages/image-cdn/src/class-image-cdn.php#L1390-L1412).

See this gist for a version that works with Tachyon. https://gist.github.com/peterwilsoncc/47481740a6bacfcbde5e063232041808

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.