-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Editor: PHP backports for Client Side Media #10868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
adamsilverstein
wants to merge
49
commits into
WordPress:trunk
from
adamsilverstein:backport-preload-changes-for-csm-70
Closed
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
7cab03d
add preload patchs for client side media
adamsilverstein bf24f67
REST API: Add media processing settings to index endpoint
adamsilverstein f20f2f9
REST API: Add filename and filesize fields to attachments
adamsilverstein a979037
REST API: Add exif_orientation field to attachments
adamsilverstein d7d04fc
REST API: Add generate_sub_sizes and convert_format params
adamsilverstein 2fc26fc
REST API: Add sideload endpoint for attachments
adamsilverstein f39001d
REST API: Improve missing_image_sizes for PDFs
adamsilverstein 2f33085
Media: Add cross-origin isolation support
adamsilverstein 2de4be6
Media: Add WASM MIME type to .htaccess rules
adamsilverstein 07ca4ad
Media: Add crossorigin attributes to media templates
adamsilverstein 4aef029
Tests: Update REST API tests for client-side media fields
adamsilverstein 1271aa0
Docs: Update @since tags from 6.9.0 to 7.0.0
adamsilverstein a66bce9
Update src/wp-includes/media.php
adamsilverstein 90af128
Update src/wp-includes/media.php
adamsilverstein 1fb7a00
Update src/wp-includes/media.php
adamsilverstein 2f569b5
Update src/wp-includes/rest-api/class-wp-rest-server.php
adamsilverstein b36bd28
Use WP_HTML_Tag_Processor in wp_override_media_templates
adamsilverstein 82832f9
Fix EXIF orientation 0 treated as valid value
adamsilverstein 7c995b0
Update REST API QUnit fixtures for Client Side Media changes
adamsilverstein 0ddb051
Add wp_client_side_media_processing_enabled filter
adamsilverstein 4134454
Apply suggestions from Weston
adamsilverstein 5b26a13
Use static closure in sideload_item
adamsilverstein 55c14ea
update gutenberg ref
adamsilverstein 4a49d48
Fix fatal error from early function call in default-filters
adamsilverstein b0c156b
update GB ref, take 2
adamsilverstein 5151c8b
update gb ref
adamsilverstein d034c01
Add client-side media processing JS flag to core
adamsilverstein 375c82b
update gb ref
adamsilverstein 4c81534
Fix method signature compatibility with parent WP_REST_Controller.
adamsilverstein 6c50ba0
update gb ref
adamsilverstein 3ae9f8e
Fix client-side media processing build issues in copy-gutenberg-build.js
adamsilverstein 53ba07d
Update src/wp-includes/media.php
adamsilverstein 7503a41
Update src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-c…
adamsilverstein caaefc2
Update src/wp-includes/media.php
adamsilverstein d57c5c1
Fix image_sizes format in REST API index for CSM
adamsilverstein f751318
Check IMG srcset for cross-origin URLs
adamsilverstein 2a54622
Clean up CSM filters on all error paths
adamsilverstein 629cb0d
Apply suggestions from code review from Weston and Mukesh
adamsilverstein 5f1debd
Use shorter path in doc block
adamsilverstein 7ac186e
Refactor cross-origin check to be data-driven
adamsilverstein c6c68dd
Add imagesrcset and poster to cross-origin checks
adamsilverstein 894a9ff
Remove wp_filter_mod_rewrite_rules_for_wasm
adamsilverstein 6b6d9e2
Add crossorigin check and docs to wp_override_media_templates
adamsilverstein dd58977
Remove unused params from filter_wp_unique_filename
adamsilverstein 9203e5d
Merge branch 'trunk' into backport-preload-changes-for-csm-70
adamsilverstein 1d4e8cd
Move crossorigin processing into wp_print_media_templates
adamsilverstein 5a62665
Fix PHPCS array declaration spacing errors
adamsilverstein 57c4f00
regenerate wp-api fixtures
adamsilverstein d56772b
Fix wp-api-generated.js fixture to match CI environment
adamsilverstein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem right. In looking at
wp_get_image_editor_output_format(), it is passing in a mapping of source format to output format as an associative array. The default value it is filtering normally:But here it is being passed an empty array, and filtering and re-filtering the same
$output_formatsvariable. And there is no$filenameparam being supplied to the filter? Is this for the sake of plugins somehow? I'm struggling to understand what this does.And is the
(object)cast needed?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good point. I was trying to capture results for each possible mime type which in theory plugins could alter based on the input mime type; as you point out, however the filename parameter is not used at all. And typically plugins would get one mime type per upload file (the original type).
A better place to put this data would be in the response to the initial image upload - i'm already doing that with the exif rotation data to keep the rotation logic in one place (on the server).
If I don't get this fixed in the current PR, I will create a follow up issue to move the logic there. That way, we can also pass in the actual input filename and mime type and filter will operate just like it does on the server side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to get this in as is then follow up to fix it during beta
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@westonruter - I created a trac ticket for this - https://core.trac.wordpress.org/ticket/64677 - I'll probably wind up applying a similar fix in GB since it will still use client side media for pre 7.0 WordPress