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 |
|---|---|
| 97 | // Make the file path relative to the upload dir |
| 98 | $metadata['file'] = _wp_relative_upload_path($file); |
| 99 | |
| 100 | // make thumbnails and other intermediate sizes |
| 101 | global $_wp_additional_image_sizes; |
| 102 | $temp_sizes = array('thumbnail', 'medium', 'large'); // Standard sizes |
| 103 | if ( isset( $_wp_additional_image_sizes ) && count( $_wp_additional_image_sizes ) ) |
| 104 | $temp_sizes = array_merge( $temp_sizes, array_keys( $_wp_additional_image_sizes ) ); |
| 105 | |
| 106 | $temp_sizes = apply_filters( 'intermediate_image_sizes', $temp_sizes ); |
| 107 | |
| 108 | foreach ( $temp_sizes as $s ) { |
| 109 | $sizes[$s] = array( 'width' => '', 'height' => '', 'crop' => FALSE ); |
| 110 | if ( isset( $_wp_additional_image_sizes[$s]['width'] ) ) |
| 111 | $sizes[$s]['width'] = intval( $_wp_additional_image_sizes[$s]['width'] ); // For theme-added sizes |
| 112 | else |
| 113 | $sizes[$s]['width'] = get_option( "{$s}_size_w" ); // For default sizes set in options |
| 114 | if ( isset( $_wp_additional_image_sizes[$s]['height'] ) ) |
| 115 | $sizes[$s]['height'] = intval( $_wp_additional_image_sizes[$s]['height'] ); // For theme-added sizes |