Skip to content

Commit

Permalink
Add value to MediaUpload to pre-select selected cover art.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdharmesh committed Mar 1, 2024
1 parent 5f579fd commit fcba01d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions assets/js/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function useFeaturedImage() {
editPost({ featured_media: 0 });
};

return { featuredImageUrl, setFeaturedImage, removeFeaturedImage };
return { featuredImageUrl, setFeaturedImage, removeFeaturedImage, featuredImageId };
}

class Edit extends Component {
Expand Down Expand Up @@ -79,7 +79,8 @@ class Edit extends Component {
attributes,
featuredImageUrl,
setFeaturedImage,
removeFeaturedImage
removeFeaturedImage,
featuredImageId
} = this.props;
const { caption, explicit } = attributes;
const duration = attributes.duration || '';
Expand Down Expand Up @@ -327,6 +328,7 @@ class Edit extends Component {
}
</Button>
)}
value={featuredImageId}
/>
</MediaUploadCheck>
{featuredImageUrl && (
Expand Down

0 comments on commit fcba01d

Please sign in to comment.