Filters the path to the attached file to update.
$filestring$attachment_idintwp-includes/post.php:878update_attached_file() * * @since 2.1.0 * * @param string $file Path to the attached file to update. * @param int $attachment_id Attachment ID. */ $file = apply_filters( 'update_attached_file', $file, $attachment_id ); $file = _wp_relative_upload_path( $file ); if ( $file ) { return update_post_meta( $attachment_id, '_wp_attached_file', $file ); } else { return delete_post_meta( $attachment_id, '_wp_attached_file' );Introduced in 2.1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.