Repository navigation
Core fields: Restore the editor.PostFeaturedImage.imageSize filter in the post editor - #86662
Conversation
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +130 B (0%) Total Size: 8.64 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. page-list submenu user interactions in
|
| /** | ||
| * The URL an image preview loads, in place of the full-size file. | ||
| */ | ||
| getPreviewUrl?: GetPreviewUrl; |
There was a problem hiding this comment.
Note that the MediaEditControl component is a private API, so this doesn't mean we're adding a new public API.
|
Thanks for the PR, @ntsekouras! I don't think we need to call the filter twice. The double call is a leftover from #15844, back when the default was
How about a single call: const size = applyFilters(
'editor.PostFeaturedImage.imageSize',
'large',
attachment.id,
postId
) as string;
return attachment.media_details?.sizes?.[ size ]?.source_url ?? attachment.source_url;IMO we can drop |
…in the post editor
45bcbd8 to
713f97e
Compare
|
Thanks George! Makes sense. I updated to a single call without |
Mamaduka
left a comment
There was a problem hiding this comment.
I left the classic PostFeaturedImage component as is, since we want to backport this to 7.2.
Makes sense. We can clean up there later.
Let's fix the CI failure for unit tests, and then it should be good to merge.
…in the post editor (#86662) Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
|
I just cherry-picked this PR to the wp/7.2 branch to get it included in the next release: 9469678 |
|
The cherry-pick of this PR to Every job that builds fails on the branch tip, along with the E2E and Playwright jobs that depend on it (build log). Open PRs against I think pointing that entry at |
|
Thanks for the ping @lancewillett! The cherry pick was automated so I didn't got a notification for the failure. I pushed in |
This updates the pinned commit hash of the Gutenberg repository from `1b0dc90c700746b108e080263a4dc67707b750a1` to `61aba5422836aeed76a794f98d3fe0da3eb5f5d1` (head of the `wp/7.2` branch). A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@1b0dc90...61aba54. - Interactivity API: Render TrustedHTML after rejecting the same markup as a string (WordPress/gutenberg#86555). - Interactivity Router: Render only the most recently started navigation (WordPress/gutenberg#86515) (WordPress/gutenberg#86608). - Block Parser: Update error-handling for stack of unclosed blocks (WordPress/gutenberg#74427). - Block Parser: Match updates from Core's default parser (WordPress/gutenberg#86078). - Upload Media: Export `isClientSideSupportedFormat()` (WordPress/gutenberg#86541) (WordPress/gutenberg#86693). - Core fields: Restore the `editor.PostFeaturedImage.imageSize` filter in the post editor (WordPress/gutenberg#86662). - Icons: Rename file to folder, add actual file icon (WordPress/gutenberg#86526) (WordPress/gutenberg#86779). - Icons: Add "database" icon (WordPress/gutenberg#85273) (WordPress/gutenberg#86853). - [WP 7.2] Icons: Map a conservative set of Dashicons to `core-admin` icons (WordPress/gutenberg#86708) (WordPress/gutenberg#86854). - Connectors: Show filesystem credentials modal on plugin install (WordPress/gutenberg#78367). - Icons: Deprecate locks-small, lock-outline, replace lock with lock-outline svg (WordPress/gutenberg#85740) (WordPress/gutenberg#86924). - Blocks: Fix duplicated content when implicitly closing a final open block (WordPress/gutenberg#86703). - ContentEditableControl: Don't focus a disabled field on click (WordPress/gutenberg#86613). - Fix iOS keyboard not opening on a tap into another block after Done (WordPress/gutenberg#86839). Removes the icons restored by this update from the `$_old_files` array to prevent them being deleted when WordPress is updated. Developed in: #16048 Props peterwilsoncc, mamaduka, wildworks, fushar. See #66340. git-svn-id: https://develop.svn.wordpress.org/trunk@65543 602fd350-edb4-49c9-b593-d223f7449a82
This updates the pinned commit hash of the Gutenberg repository from `1b0dc90c700746b108e080263a4dc67707b750a1` to `61aba5422836aeed76a794f98d3fe0da3eb5f5d1` (head of the `wp/7.2` branch). A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@1b0dc90...61aba54. - Interactivity API: Render TrustedHTML after rejecting the same markup as a string (WordPress/gutenberg#86555). - Interactivity Router: Render only the most recently started navigation (WordPress/gutenberg#86515) (WordPress/gutenberg#86608). - Block Parser: Update error-handling for stack of unclosed blocks (WordPress/gutenberg#74427). - Block Parser: Match updates from Core's default parser (WordPress/gutenberg#86078). - Upload Media: Export `isClientSideSupportedFormat()` (WordPress/gutenberg#86541) (WordPress/gutenberg#86693). - Core fields: Restore the `editor.PostFeaturedImage.imageSize` filter in the post editor (WordPress/gutenberg#86662). - Icons: Rename file to folder, add actual file icon (WordPress/gutenberg#86526) (WordPress/gutenberg#86779). - Icons: Add "database" icon (WordPress/gutenberg#85273) (WordPress/gutenberg#86853). - [WP 7.2] Icons: Map a conservative set of Dashicons to `core-admin` icons (WordPress/gutenberg#86708) (WordPress/gutenberg#86854). - Connectors: Show filesystem credentials modal on plugin install (WordPress/gutenberg#78367). - Icons: Deprecate locks-small, lock-outline, replace lock with lock-outline svg (WordPress/gutenberg#85740) (WordPress/gutenberg#86924). - Blocks: Fix duplicated content when implicitly closing a final open block (WordPress/gutenberg#86703). - ContentEditableControl: Don't focus a disabled field on click (WordPress/gutenberg#86613). - Fix iOS keyboard not opening on a tap into another block after Done (WordPress/gutenberg#86839). Removes the icons restored by this update from the `$_old_files` array to prevent them being deleted when WordPress is updated. Developed in: WordPress/wordpress-develop#16048 Props peterwilsoncc, mamaduka, wildworks, fushar. See #66340. Built from https://develop.svn.wordpress.org/trunk@65543 git-svn-id: http://core.svn.wordpress.org/trunk@64616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the pinned commit hash of the Gutenberg repository from `1b0dc90c700746b108e080263a4dc67707b750a1` to `61aba5422836aeed76a794f98d3fe0da3eb5f5d1` (head of the `wp/7.2` branch). A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@1b0dc90...61aba54. - Interactivity API: Render TrustedHTML after rejecting the same markup as a string (WordPress/gutenberg#86555). - Interactivity Router: Render only the most recently started navigation (WordPress/gutenberg#86515) (WordPress/gutenberg#86608). - Block Parser: Update error-handling for stack of unclosed blocks (WordPress/gutenberg#74427). - Block Parser: Match updates from Core's default parser (WordPress/gutenberg#86078). - Upload Media: Export `isClientSideSupportedFormat()` (WordPress/gutenberg#86541) (WordPress/gutenberg#86693). - Core fields: Restore the `editor.PostFeaturedImage.imageSize` filter in the post editor (WordPress/gutenberg#86662). - Icons: Rename file to folder, add actual file icon (WordPress/gutenberg#86526) (WordPress/gutenberg#86779). - Icons: Add "database" icon (WordPress/gutenberg#85273) (WordPress/gutenberg#86853). - [WP 7.2] Icons: Map a conservative set of Dashicons to `core-admin` icons (WordPress/gutenberg#86708) (WordPress/gutenberg#86854). - Connectors: Show filesystem credentials modal on plugin install (WordPress/gutenberg#78367). - Icons: Deprecate locks-small, lock-outline, replace lock with lock-outline svg (WordPress/gutenberg#85740) (WordPress/gutenberg#86924). - Blocks: Fix duplicated content when implicitly closing a final open block (WordPress/gutenberg#86703). - ContentEditableControl: Don't focus a disabled field on click (WordPress/gutenberg#86613). - Fix iOS keyboard not opening on a tap into another block after Done (WordPress/gutenberg#86839). Removes the icons restored by this update from the `$_old_files` array to prevent them being deleted when WordPress is updated. Developed in: WordPress#16048 Props peterwilsoncc, mamaduka, wildworks, fushar. See #66340. git-svn-id: https://develop.svn.wordpress.org/trunk@65543 602fd350-edb4-49c9-b593-d223f7449a82
…in the post editor (WordPress#86662) Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
What?
Part of: #76076
As Aki noticed, since the post sidebar is based on DataForm the
editor.PostFeaturedImage.imageSizefilter has no effect anymore. Also the featured image preview loads the full size image, while the classic panel loaded thelargesize, falling back tothumbnailand then the full size.This PR applies the filter to the featured image field in the post editor, with the same sizes and order as the classic panel. Quick Edit is not affected and still loads the full image, like we do for the other back compat filters (
editor.PostFeaturedImageandeditor.MediaUpload) that only apply in the post editor.For this
MediaEditControlinmedia-utilsgets agetPreviewUrlprop, so nothing changes for the other media fields. I also updated the filter's docs, which still mentionedpost-thumbnailas the default (outdated since #40126), and brought back the featured image field tests that were removed with the old@wordpress/fieldscopy in #84897.Testing Instructions
test/e2e/assets/2000x1200_e2e_test_image_indexed.png).largesize (...-1024x614.png) and not the original.mediumsize (...-300x180.png).You can also test with the Image Regenerate & Select Crop plugin, which sets the filter from Settings > Media > Size in meta box.
Use of AI Tools
Generated with Opus 5.5 and adjusted/reviewed manually.