wp_prepare_attachment_for_js хук-фильтрWP 3.5.0

Filters the attachment data prepared for JavaScript.

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

add_filter( 'wp_prepare_attachment_for_js', 'wp_kama_prepare_attachment_for_js_filter', 10, 3 );

/**
 * Function for `wp_prepare_attachment_for_js` filter-hook.
 * 
 * @param array       $response   Array of prepared attachment data. @see wp_prepare_attachment_for_js().
 * @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_prepare_attachment_for_js_filter( $response, $attachment, $meta ){

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

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

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

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

wp_prepare_attachment_for_js()
wp_prepare_attachment_for_js
wp-includes/media.php 4341
return apply_filters( 'wp_prepare_attachment_for_js', $response, $attachment, $meta );

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

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