get_image_tag_class хук-фильтрWP 2.6.0

Filters the value of the attachment's image tag class attribute.

Использование

add_filter( 'get_image_tag_class', 'wp_kama_get_image_tag_class_filter', 10, 4 );

/**
 * Function for `get_image_tag_class` filter-hook.
 * 
 * @param string       $class CSS class name or space-separated list of classes.
 * @param int          $id    Attachment ID.
 * @param string       $align Part of the class name for aligning the image.
 * @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).
 *
 * @return string
 */
function wp_kama_get_image_tag_class_filter( $class, $id, $align, $size ){

	// filter...
	return $class;
}
$class(строка)
CSS class name or space-separated list of classes.
$id(int)
Attachment ID.
$align(строка)
Part of the class name for aligning the image.
$size(строка|int[])
Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order).

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

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

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

get_image_tag()
get_image_tag_class
wp-includes/media.php 394
$class = apply_filters( 'get_image_tag_class', $class, $id, $align, $size );

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

Использование не найдено.