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.5.2

apply_filters('wp_get_attachment_image_attributes') is found 1 times:

  • /wp-includes/media.php line 1149
    		 * @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 );
    
    		$attr = array_map( 'esc_attr', $attr );
    		$html = rtrim( "<img $hwstring" );
    
    		foreach ( $attr as $name => $value ) {
    			$html .= " $name=" . '"' . $value . '"';
    

See this hook used in plugins: