jaredatch/Custom-Metaboxes-and-Fields-for-WordPress — pull request #30 by randyhoyt (2011-10-11 17:07:28+00:00)
Title: Modifications to file field

I have modified the file field in two ways:

* It now always has an Insert Into Post button, which is changed with jQuery to read "Use As Field Name." (#12)
* It can now save the attachment ID in a separate custom field. (#27)

(By default, the file field will *not* save the ID. In the example below, it will save a second field with a meta_key of rrh_book_cover**_id** that contains the ID.)

```
array(
'name' => 'Cover',
'id' => 'rrh_book_cover',
'type' => 'file',
'save' => array('url','id')
),
```