New answers tagged

2

The code below will only run once whenever a file is uploaded. We keep an array ( $image_mimes ) of acceptable image-mimetypes We get the current attachment mime type We make sure what is given is indeed an image ( because we don't need unnecessary postmeta cluttering our table ) We grab the title from the attachment and set it to the alt-text initially ...



Top 50 recent answers are included