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

Filters 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, або 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 )
Приоб’єднанні об’єкта.
$meta
(масив|false)
Array of attachment meta data, або false if there is none.

список змін

З версії 5.9.0Введено.

Де викликається хук

acf/load_attachment

acf/includes/api/api-helpers.php 3078

return apply_filters( 'acf/load_attachment', $response, $attachment, $meta);

Де використовується хук в Advanced Custom Fields

Використання не знайдено.

Залишити відповідь

Ваша e-mail адреса не оприлюднюватиметься. Обов’язкові поля позначені *