From fcba01dfc2104de6561d026d073de600184d4b26 Mon Sep 17 00:00:00 2001 From: Dharmesh Patel Date: Fri, 1 Mar 2024 14:57:01 +0530 Subject: [PATCH] Add value to `MediaUpload` to pre-select selected cover art. --- assets/js/edit.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/js/edit.js b/assets/js/edit.js index f2b736a..d7db03a 100644 --- a/assets/js/edit.js +++ b/assets/js/edit.js @@ -51,7 +51,7 @@ function useFeaturedImage() { editPost({ featured_media: 0 }); }; - return { featuredImageUrl, setFeaturedImage, removeFeaturedImage }; + return { featuredImageUrl, setFeaturedImage, removeFeaturedImage, featuredImageId }; } class Edit extends Component { @@ -79,7 +79,8 @@ class Edit extends Component { attributes, featuredImageUrl, setFeaturedImage, - removeFeaturedImage + removeFeaturedImage, + featuredImageId } = this.props; const { caption, explicit } = attributes; const duration = attributes.duration || ''; @@ -327,6 +328,7 @@ class Edit extends Component { } )} + value={featuredImageId} /> {featuredImageUrl && (