wp_image_maybe_exif_rotate
Filters the $orientation value to correct it before rotating or to prevent rotating the image.
Использование
add_filter( 'wp_image_maybe_exif_rotate', 'wp_kama_image_maybe_exif_rotate_filter', 10, 2 ); /** * Function for `wp_image_maybe_exif_rotate` filter-hook. * * @param int $orientation EXIF Orientation value as retrieved from the image file. * @param string $file Path to the image file. * * @return int */ function wp_kama_image_maybe_exif_rotate_filter( $orientation, $file ){ // filter... return $orientation; }
- $orientation(int)
- EXIF Orientation value as retrieved from the image file.
- $file(строка)
- Path to the image file.
Список изменений
С версии 5.3.0 | Введена. |
Где вызывается хук
wp_image_maybe_exif_rotate
wp-includes/class-wp-image-editor.php 500
$orientation = apply_filters( 'wp_image_maybe_exif_rotate', $orientation, $this->file );