0

I am extending the WP_Customize_Image_Control as a means to include an upload-able word mark for a site. The control works just fine, but I need to do some post process handling on the image (i.e. check image dimensions, file type, etc...). In other words I need to validate the upload. Is there an event listener in the javascript of the API, that I can override, in order to do this?

2
  • Your going to want to do your validation in php that way you can save / delete / modify the image based on the results. Do some google searching, i know you can get file extensions and file sizes using php, i believe you can also get dimensions. Look into mime types for determining the file type.
    – Vigs
    Commented Jul 18, 2013 at 17:12
  • Thanks, but I have the PHP processing part down, I am looking for a event listener in the javascript that will prevent the upload from occurring. I may not have worded my question correctly, but I need to catch the upload process, and tell the user that the uploaded image is not valid.
    – cj5
    Commented Jul 18, 2013 at 17:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.