acf/load_attachment filter-hookACF 5.9.0

Filters the attachment $response after it has been loaded.

Usage

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)
Array of loaded attachment data.
$attachment(WP_Post)
Attachment object.
$meta(array|false)
Array of attachment meta data, or false if there is none.

Changelog

Since 5.9.0 Introduced.

Where the hook is called

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

Where the hook is used in Advanced Custom Fields PRO

Usage not found.