wp_calculate_image_srcset_meta хук-фильтр . WP 4.5.0
Let plugins pre-filter the image meta to be able to fix inconsistencies in the stored data.
Использование
add_filter( 'wp_calculate_image_srcset_meta', 'filter_function_name_9946', 10, 4 ); function filter_function_name_9946( $image_meta, $size_array, $image_src, $attachment_id ){ // filter... return $image_meta; }
- $image_meta(массив)
- The image meta data as returned by 'wp_get_attachment_metadata()'.
- $size_array(число[])
An array of requested width and height values.
-
0(число)
The width in pixels. - 1(число)
The height in pixels.
-
- $image_src(строка)
- The 'src' of the image.
- $attachment_id(число)
- The image attachment ID or 0 if not supplied.
Список изменений
С версии 4.5.0 | Введена. |
Где вызывается хук
wp-includes/media.php 1258
$image_meta = apply_filters( 'wp_calculate_image_srcset_meta', $image_meta, $size_array, $image_src, $attachment_id );