wordpress-settings-api-class icon indicating copy to clipboard operation
wordpress-settings-api-class copied to clipboard

Add image field type

Open roidayan opened this issue 9 years ago • 11 comments

Works the same as file field type but with a preview of the image.

Signed-off-by: Roi Dayan [email protected]

roidayan avatar May 19 '15 21:05 roidayan

hi, any comments?

roidayan avatar Dec 23 '15 06:12 roidayan

Hi @tareq1988 any comments?

roidayan avatar Sep 08 '16 04:09 roidayan

Sorry for the long delay on reviewing this. Ideally I would like to store the attachment ID instead of image URL as we might need various sizes of that image and finding an attachment ID with URL will be a nightmare. So we could pass the attachment ID as a hidden field, a thumbnail version of the image preview (right now it shows the full size). Also limit the media manager to image-only selection, we certainly don't want to select a zip file as an image file.

tareq1988 avatar Sep 27 '16 06:09 tareq1988

ok thanks for the comments.

roidayan avatar Sep 27 '16 06:09 roidayan

The point at first was to be able to supply external url as well. With your suggestions only the button and preview are needed (without the input box). the media manager has an upload tab to add external file into the media manager.

roidayan avatar Sep 27 '16 07:09 roidayan

another note. showing the original image was the point of showing the user the real preview of the size that is going to be used. i.e. i use it for adding image for email header and wanted the user to see preview of the image in real size. I guess this could be configurable of what kind of preview to show.

roidayan avatar Sep 27 '16 08:09 roidayan

Consider a raw image uploaded, or a fairly medium sized 1200x800, it would overflow the whole settings area.

tareq1988 avatar Sep 27 '16 08:09 tareq1988

right, but in my example if i requested header email image then it can be considered a user mistake choosing image size that large. the default can be thumb if not specified. i'll split this into different commit later.

roidayan avatar Sep 27 '16 08:09 roidayan

hi @tareq1988 , too bad this didn't get merged. I would like to revive this. we talked about user attaching raw img and code was updated to show thumbnail is exists. i see a rebase is needed so i'll do that after some comments.

roidayan avatar May 02 '20 15:05 roidayan

@roidayan and @tareq1988 just tested this code within my project and all in working, great. Thank @roidayan

Definitely prefer the image field over the file, easier for my client to see what they have attached.

If you need help maintaining the repo will be happy to help, I see there are a few pull requests outstanding.

tomphilpotts avatar Feb 01 '21 16:02 tomphilpotts

thanks. i'm still using this plugin as well. great thing.

roidayan avatar Feb 04 '21 13:02 roidayan