Filter hook 'wp_get_attachment_image_attributes'

in WP Core File wp-includes/media.php at line 1151

Description

Filters the list of attachment image attributes.

Occurrences

Filename Line Number
wp-includes/media.php 1151

Parameters

Type Name Description
string[] $attr Array of attribute values for the image markup, keyed by attribute name. See wp_get_attachment_image().
WP_Post $attachment Image attachment post.
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).

Usage Examples

Example 1

add_filter( 'wp_get_attachment_image_attributes', '_wp_post_thumbnail_class_filter'

PHP Doc

/**
		 * Filters the list of attachment image attributes.
		 *
		 * @since 2.8.0
		 *
		 * @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).
		 */