wp_get_attachment_image_src хук-фильтр . WP 4.3.0
Filters the attachment image source result.
Использование
add_filter( 'wp_get_attachment_image_src', 'filter_function_name_5390', 10, 4 ); function filter_function_name_5390( $image, $attachment_id, $size, $icon ){ // filter... return $image; }
- $image(массив/false)
Array of image data, or boolean false if no image is available.
-
0(строка)
Image source URL. -
1(число)
Image width in pixels. -
2(число)
Image height in pixels. - 3(true/false)
Whether the image is a resized image.
-
- $attachment_id(число)
- Image attachment ID.
- $size(строка/число[])
- Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order).
- $icon(true/false)
- Whether the image should be treated as an icon.
Список изменений
С версии 4.3.0 | Введена. |
Где вызывается хук
wp_get_attachment_image_src
wp-includes/media.php 991
return apply_filters( 'wp_get_attachment_image_src', $image, $attachment_id, $size, $icon );