Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: thumbnail_filename

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
776                     $image_ratio = $image_height / $image_new_height;
777                     $image_new_width = $image_width / $image_ratio;
778                     //height > width
779                }
780
781                $thumbnail = imagecreatetruecolor($image_new_width, $image_new_height);
782                @ imagecopyresampled($thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $image_attr[0], $image_attr[1]);
783
784                // If no filters change the filename, we'll do a default transformation.
785                if ( basename($file) == $thumb = apply_filters('thumbnail_filename', basename($file)) )
786                     $thumb = preg_replace('!(\.[^.]+)?$!', __('.thumbnail').'$1', basename($file), 1);
787
788                $thumbpath = str_replace(basename($file), $thumb, $file);
789
790                // move the thumbnail to it's final destination
791                if ($type[2] == 1) {
792                     if (!imagegif($thumbnail, $thumbpath)) {
793                          $error = __("Thumbnail path invalid");
794                     }