wp_create_file_in_uploads хук-фильтрWP 2.1.0

Filters the attachment file path after the custom header or background image is set.

Used for file replication.

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

add_filter( 'wp_create_file_in_uploads', 'wp_kama_create_file_in_uploads_filter', 10, 2 );

/**
 * Function for `wp_create_file_in_uploads` filter-hook.
 * 
 * @param string $file          Path to the file.
 * @param int    $attachment_id Attachment ID.
 *
 * @return string
 */
function wp_kama_create_file_in_uploads_filter( $file, $attachment_id ){

	// filter...
	return $file;
}
$file(строка)
Path to the file.
$attachment_id(int)
Attachment ID.

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

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

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

Custom_Image_Header::step_2()
wp_create_file_in_uploads
wp_ajax_crop_image()
wp_create_file_in_uploads
Custom_Background::handle_upload()
wp_create_file_in_uploads
Custom_Image_Header::step_3()
wp_create_file_in_uploads
Custom_Image_Header::ajax_header_crop()
wp_create_file_in_uploads
wp-admin/includes/class-custom-image-header.php 896
$file = apply_filters( 'wp_create_file_in_uploads', $file, $attachment_id ); // For replication.
wp-admin/includes/ajax-actions.php 4042
$cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.
wp-admin/includes/ajax-actions.php 4071
$cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.
wp-admin/includes/class-custom-background.php 578
$file = apply_filters( 'wp_create_file_in_uploads', $file, $id ); // For replication.
wp-admin/includes/class-custom-image-header.php 919
$image = apply_filters( 'wp_create_file_in_uploads', $image, $attachment_id ); // For replication.
wp-admin/includes/class-custom-image-header.php 1078
$cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.
wp-admin/includes/class-custom-image-header.php 1424
$cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.

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

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