0

I'm trying to do a modal where I can edit the thumbnail of a specific post, and I wanted to know if it's possible to call and use the Core WP image editor inside this modal and be able there to Crop the image for example, and then save it a replace it for the thumbnail of the actual post. So far I have been able to open the Media Library but not the specific image edition. Thanks for your responses and I'll appreciate your help! This is just an example image! enter image description here

3
  • 1
    Is this modal on the frontend or the backend? And is the user logged in or out? Is this cropping happening to an image before upload, or after it has already been uploaded and added to the media library? If it's in the admin and it's in a post editor, which editor are you using? (classic? block? pagebuilder? site editor? options page? etc )
    – Tom J Nowell
    CommentedFeb 27 at 11:35
  • Hi @TomJNowell thanks for your response! This modal is on the frontend for logged admin users that want to edit the thumbnail of the post, the image is already uploaded as the post is already created before in other page, the thumbnails are uploaded to S3 so I assume I need to do a workaround downloading the image in order to be able to edit it inside the Core Image Editor but this is for later, right now I just wanted to be able to use the editor with the specific image inside the Modal since I'm not using any other editor, so far I get to open the whole Media Lib, not the single image editor
    – sinned
    CommentedFeb 28 at 11:28
  • it might be easier/safer to instead support replacing the image with a new one, and load the full size version of the image into a generic JS cropping library rather than trying to shunt the version from core into the frontend, core's image cropping tool is old and built on top of backbone js, so much so that the block editor doesn't use the same cropping tools, e.g. the block editor/gutenberg uses react-easy-crop internally ( github.com/ValentinH/react-easy-crop )
    – Tom J Nowell
    CommentedFeb 28 at 16:46

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.