attachment_thumbnail_args хук-фильтрWP 3.9.0

Filters the parameters for the attachment thumbnail creation.

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

add_filter( 'attachment_thumbnail_args', 'wp_kama_attachment_thumbnail_args_filter', 10, 3 );

/**
 * Function for `attachment_thumbnail_args` filter-hook.
 * 
 * @param array $image_attachment An array of parameters to create the thumbnail.
 * @param array $metadata         Current attachment metadata.
 * @param array $uploaded         Information about the newly-uploaded file.
 *
 * @return array
 */
function wp_kama_attachment_thumbnail_args_filter( $image_attachment, $metadata, $uploaded ){

	// filter...
	return $image_attachment;
}
$image_attachment(массив)
An array of parameters to create the thumbnail.
$metadata(массив)
Current attachment metadata.
$uploaded(массив)

Information about the newly-uploaded file.

  • file(строка)
    Filename of the newly-uploaded file.

  • url(строка)
    URL of the uploaded file.

  • type(строка)
    File type.

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

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

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

wp_generate_attachment_metadata()
attachment_thumbnail_args
wp-admin/includes/image.php 568
$image_attachment = apply_filters( 'attachment_thumbnail_args', $image_attachment, $metadata, $uploaded );

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

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