wp_image_file_matches_image_meta
Filters whether an image path or URI matches image meta.
Использование
add_filter( 'wp_image_file_matches_image_meta', 'wp_kama_image_file_matches_meta_filter', 10, 4 ); /** * Function for `wp_image_file_matches_image_meta` filter-hook. * * @param bool $match Whether the image relative path from the image meta matches the end of the URI or path to the image file. * @param string $image_location Full path or URI to the tested image file. * @param array $image_meta The image meta data as returned by 'wp_get_attachment_metadata()'. * @param int $attachment_id The image attachment ID or 0 if not supplied. * * @return bool */ function wp_kama_image_file_matches_meta_filter( $match, $image_location, $image_meta, $attachment_id ){ // filter... return $match; }
- $match(true|false)
- Whether the image relative path from the image meta matches the end of the URI or path to the image file.
- $image_location(строка)
- Full path or URI to the tested image file.
- $image_meta(массив)
- The image meta data as returned by 'wp_get_attachment_metadata()'.
- $attachment_id(int)
- The image attachment ID or 0 if not supplied.
Список изменений
С версии 5.5.0 | Введена. |
Где вызывается хук
wp_image_file_matches_image_meta
wp-includes/media.php 1676
return apply_filters( 'wp_image_file_matches_image_meta', $match, $image_location, $image_meta, $attachment_id );