update_attached_file ( $attachment_id, $file )
- (int) $attachment_id Attachment ID.
- (string) $file File path for the attachment.
- (bool) True on success, false on failure.
- Introduced in WordPress: 2.1.0
- Deprecated in WordPress: —
Update attachment file path based on attachment ID.
Used to update the file path of the attachment, which uses post meta name
'_wp_attached_file' to store the path of the attachment.