Welcome, visitor! Log in
 

Source View: wp_create_thumbnail

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.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: 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.

Source View

Line Code
93
94           }
95      } else {
96           $error = __( 'File not found' );
97      }
98
99      if (!empty ( $error ) ) {
100           return $error;
101      } else {
102           return apply_filters( 'wp_create_thumbnail', $thumbpath );
103      }
104 }
105
106 function wp_crop_image( $src_file, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs = false, $dst_file = false ) {
107      if ( ctype_digit( $src_file ) ) // Handle int as attachment ID
108           $src_file = get_attached_file( $src_file );
109
110      $src = wp_load_image( $src_file );
111