wp_create_file_in_uploads filter-hookWP 2.1.0

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

Used for file replication.

Usage

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(string)
Path to the file.
$attachment_id(int)
Attachment ID.

Changelog

Since 2.1.0 Introduced.

Where the hook is called

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 4038
$cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.
wp-admin/includes/ajax-actions.php 4067
$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.

Where the hook is used in WordPress

Usage not found.