WordPress at a glance
filter is not described

wp_get_attachment_image_attributes filter-hook . WP 2.8.0

Filters the list of attachment image attributes.


add_filter( 'wp_get_attachment_image_attributes', 'filter_function_name_1212', 10, 3 );
function filter_function_name_1212( $attr, $attachment, $size ){
	// filter...

	return $attr;
Array of attribute values for the image markup, keyed by attribute name. See wp_get_attachment_image().
Image attachment post.
Requested size. Image size or array of width and height values (in that order).
Default: 'thumbnail'

Список изменений

С версии 2.8.0 Введена.

Где вызывается хук

wp-includes/media.php 1092
$attr = apply_filters( 'wp_get_attachment_image_attributes', $attr, $attachment, $size );

Где используется хук в ядре WordPress

wp-includes/media.php 1948
add_filter( 'wp_get_attachment_image_attributes', '_wp_post_thumbnail_class_filter' );
wp-includes/media.php 1961
remove_filter( 'wp_get_attachment_image_attributes', '_wp_post_thumbnail_class_filter' );