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 |
|---|---|
| 267 | $meta['caption'] = utf8_encode(trim($iptc['2#120'][0])); |
| 268 | if ( !empty($iptc['2#116'][0]) ) // copyright |
| 269 | $meta['copyright'] = utf8_encode(trim($iptc['2#116'][0])); |
| 270 | if ( !empty($iptc['2#005'][0]) ) // title |
| 271 | $meta['title'] = utf8_encode(trim($iptc['2#005'][0])); |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | // fetch additional info from exif if available |
| 276 | if ( is_callable('exif_read_data') && in_array($sourceImageType, apply_filters('wp_read_image_metadata_types', array(IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM)) ) ) { |
| 277 | $exif = @exif_read_data( $file ); |
| 278 | if (!empty($exif['FNumber'])) |
| 279 | $meta['aperture'] = round( wp_exif_frac2dec( $exif['FNumber'] ), 2 ); |
| 280 | if (!empty($exif['Model'])) |
| 281 | $meta['camera'] = trim( $exif['Model'] ); |
| 282 | if (!empty($exif['DateTimeDigitized'])) |
| 283 | $meta['created_timestamp'] = wp_exif_date2ts($exif['DateTimeDigitized']); |
| 284 | if (!empty($exif['FocalLength'])) |
| 285 | $meta['focal_length'] = wp_exif_frac2dec( $exif['FocalLength'] ); |