Filters the list of attachment image attributes.
$attrstring[]$attachmentWP_Post$sizestring|int[]wp-includes/media.php:1201wp_get_attachment_image() * @param string[] $attr Array of attribute values for the image markup, keyed by attribute name. * See wp_get_attachment_image(). * @param WP_Post $attachment Image attachment post. * @param string|int[] $size Requested image size. Can be any registered image size name, or * an array of width and height values in pixels (in that order). */ $attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment, $size ); if ( isset( $attr['width'] ) && is_numeric( $attr['width'] ) ) { $width = absint( $attr['width'] ); } if ( isset( $attr['height'] ) && is_numeric( $attr['height'] ) ) { $height = absint( $attr['height'] );Introduced in 2.8.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.