wp_get_attachment_image_attributes

wp_get_attachment_image_attributes

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.8.2

apply_filters('wp_get_attachment_image_attributes') is found 1 times:

  • /wp-includes/media.php line 1168
    		 * @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['height'] ) && is_numeric( $attr['height'] ) ) {
    			$height = absint( $attr['height'] );
    		}
    		if ( isset( $attr['width'] ) && is_numeric( $attr['width'] ) ) {
    			$width = absint( $attr['width'] );
    

See this hook used in plugins: