Change Output for Images in Content

One way is to do this dynamically: function do_the_replacements($matches){ // $matches[0] = full string // $matches[1] = link attributes // $matches[2] = link contentes (the image) // change ‘someclass’ here… if(strpos($matches[2], ‘someclass’) !== false){ return ‘ <div class=”featured-img”> <a ‘.$matches[1].’>’.$matches[2].'</a> <div class=”corner-nw”></div> <div class=”corner-ne”></div> <div class=”corner-sw”></div> <div class=”corner-se”></div> </div> ‘; } // no matches, leave … Read more

Convert uploaded PNG to JPEG automatically

There is a way, I recommend you combine the imagefx plugin with a custom function , http://wordpress.org/extend/plugins/imagefx/ You can read about it here: http://ottopress.com/tag/gd/ , and use a function like one found here: https://stackoverflow.com/questions/1201798/use-php-to-convert-png-to-jpg-with-compression It would look something like (not tested): imagefx_register_filter(‘custom-name’,’my_custom_filter’); function my_custom_filter(&$image, $outputFile, $quality) { $image = imagecreatefrompng(&$image); imagejpeg($image, $outputFile, $quality); imagedestroy($image); } … Read more

hide/protect original full-size images

I was looking for a way to do this and found this page… then I thought of putting this in a .htaccess file in the WordPress uploads folder and it works for me so far… any good? <FilesMatch “\.jpg$”> order allow,deny deny from all </FilesMatch> <FilesMatch “-[0-9]+x[0-9]+\.jpg$”> order allow,deny allow from all </FilesMatch> The first … Read more

upload image in a meta box

You may want to take a look at Steve Taylors plugin and his approach here Dominik “ocean90” Schilling – the author of the (new in 3.5) media library, has a GitHub repository where he shows off some demos. In short, you might not be able to implement a drag&drop style media uploader in a meta … Read more