evertiro / historical-redux2

A simple, easily extendable options framework for WordPress based on NHP Theme Options Framework.
http://reduxframework.com
Other
105 stars 43 forks source link

Upload Field : Value should be stored in the database as the attachment ID #149

Closed mcaskill closed 11 years ago

mcaskill commented 11 years ago

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.

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.

Cheers,

evertiro commented 11 years ago

We've got a complete rewrite of the media manager in v3.0.0, you get your wish!