Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving URL or attachment_id on file/image fields #48

Open
tareq1988 opened this issue May 20, 2015 · 6 comments
Open

Saving URL or attachment_id on file/image fields #48

tareq1988 opened this issue May 20, 2015 · 6 comments

Comments

@tareq1988
Copy link
Owner

Right now we are saving attachment URLs in the option. Wouldn't it be better to save attachment ids instead?

So if its a file, we can use wp_get_attachment_url(). If its an image, we could get full, thumbnail, medium images if we wanted. What do you guys think?

Changing to attachment_id will also break the existing forms as users are already fetching URLs and acting on that.

@roidayan
Copy link
Contributor

but it also means it must use the media uploader. you won't be able to use external url.

@tareq1988
Copy link
Owner Author

For external url, you can use the text input anyway.

@roidayan
Copy link
Contributor

yes so maybe i dont understand what the ticket is about. adding another field that will use attachment id?

@tareq1988
Copy link
Owner Author

No, the existing file field saves the URL, from now it'll save the attachment id. Right now you can copy paste external urls, but it doesn't have to be a file field, you could use a text field to save anything including an url.

@roidayan
Copy link
Contributor

I use the file field so user can use the media uploader or use a link. i dont want a text field here.

@fredbradley
Copy link

Just by way of a plus one... saving the attachment_id would be far more useful than saving the full url.

I want to allow users to upload one file (it's a default fallback in case contributors don't set a featured image on posts) because it's an IMAGE I want to be able to interact with it so I can get the thumb size, medium size, etc etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants