Currently, the Upload Field stores the attachment URL in the database. I think it would be more practical to store the attachment ID and offer a field setting to return value as either Object, URL, or ID.
array(
'id' => 'foobar',
'type' => 'upload',
'title' => __('Lorem Ipsum'),
'std' => get_template_directory_uri() . '/images/qux.png', // or an attachment ID
'format' => 'id' // url, object, id
)
This will permit a wider range of control over the attachment, such as choice of image size and post meta.
I'd offer a pull request but I'm still unfamiliar with the Settings API at the moment and thus haven't looked into it yet.
File : /options/fields/upload/field_upload.js
Currently, the Upload Field stores the attachment URL in the database. I think it would be more practical to store the attachment ID and offer a field setting to return value as either Object, URL, or ID.
This will permit a wider range of control over the attachment, such as choice of image size and post meta.
I'd offer a pull request but I'm still unfamiliar with the Settings API at the moment and thus haven't looked into it yet.
Cheers,