WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
63 | $image_ratio = $image_height / $image_new_height; |
64 | $image_new_width = $image_width / $image_ratio; |
65 | //height > width |
66 | } |
67 |
|
68 | $thumbnail = imagecreatetruecolor( $image_new_width, $image_new_height); |
69 | @ imagecopyresampled( $thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $image_attr[0], $image_attr[1] ); |
70 |
|
71 | // If no filters change the filename, we'll do a default transformation. |
72 | if ( basename( $file ) == $thumb = apply_filters( 'thumbnail_filename', basename( $file ) ) ) |
73 | $thumb = preg_replace( '!(\.[^.]+)?$!', '.thumbnail' . '$1', basename( $file ), 1 ); |
74 |
|
75 | $thumbpath = str_replace( basename( $file ), $thumb, $file ); |
76 |
|
77 | // move the thumbnail to its final destination |
78 | if ( $type[2] == 1 ) { |
79 | if (!imagegif( $thumbnail, $thumbpath ) ) { |
80 | $error = __( "Thumbnail path invalid" ); |
81 | } |