wp_image_src_get_dimensions filter-hook . WP 5.7.0
Filters the 'wp_image_src_get_dimensions' value.
Usage
add_filter( 'wp_image_src_get_dimensions', 'filter_function_name_1939', 10, 4 ); function filter_function_name_1939( $dimensions, $image_src, $image_meta, $attachment_id ){ // filter... return $dimensions; }
- $dimensions(array|false)
- Array with first element being the width and second element being the height, or false if dimensions could not be determined.
- $image_src(string)
- The image source file.
- $image_meta(array)
- The image meta data as returned by 'wp_get_attachment_metadata()'.
- $attachment_id(int)
- The image attachment ID.
Changelog
Since 5.7.0 | Introduced. |
Where the hook is called
wp_image_src_get_dimensions
wp-includes/media.php 1644
return apply_filters( 'wp_image_src_get_dimensions', $dimensions, $image_src, $image_meta, $attachment_id );