I need to show a alert popup on clicking Insert into Post button in Media Library of WordPress, if the selected Image is less than some width and height in Library. Where can I find the onClick event of that Insert Into Post button, I tried media.php, media-views.js and much more files but couldn’t find the code.

When the selected image size is less than 500(width,height), and user click on Insert Into Post, it shows an alert box with message and return to the same page.

  • What problem are you trying to solve? Have you considered rejecting image uploads that are smaller than 500px instead? – Tom J Nowell Jul 31 '18 at 16:23
  • Hi @tom: Yes I already rejected that, but in Media Library I have tons of uploaded images, in which I want to put restriction to insert into post. – user147852 Jul 31 '18 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.