acf/load_attachment хук-фильтрACF 5.9.0

Filters the attachment $response after it has been loaded.

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

add_filter( 'acf/load_attachment', 'wp_kama_acf_load_attachment_filter', 10, 3 );

/**
 * Function for `acf/load_attachment` filter-hook.
 * 
 * @param array       $response   Array of loaded attachment data.
 * @param WP_Post     $attachment Attachment object.
 * @param array|false $meta       Array of attachment meta data, or false if there is none.
 *
 * @return array
 */
function wp_kama_acf_load_attachment_filter( $response, $attachment, $meta ){

	// filter...
	return $response;
}
$response(массив)
Array of loaded attachment data.
$attachment(WP_Post)
Attachment object.
$meta(массив|false)
Array of attachment meta data, or false if there is none.

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

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

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

acf_get_attachment()
acf/load_attachment
acf/includes/api/api-helpers.php 3052
return apply_filters( 'acf/load_attachment', $response, $attachment, $meta );

Где используется хук в Advanced Custom Fields PRO

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