-
Notifications
You must be signed in to change notification settings - Fork 110
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
Media access - store ID of media, not just URL #88
Comments
Update: it appears poster Dameian on farinspace wrote a javascript fix for this in 2011(!!!) that didn't make it into the code. Also the wonderful helgatheviking posted a rewrite of the form field with image preview using the source URL, which is the only thing stored. This requires a constant WPALCHEMY to be defined elsewhere. I will test and report if these fixes are still working … The ideal solution, it seems to me, would be to store an entire post object array for the media, like ID, URL, width, height, etc. so it can be accessible in a similar manner to post thumbnails. I wish I knew how to do this. (: |
Just in case this helps someone else, I was able to work around this problem with this bit of code in my loop:
They key is to get a unique value for each possible attachment if there is more than one, and that can be accomplished using the guid field in the posts table. Sure, it is another DB call, but not an especially heavy one. Worked for me. |
$wpalchemy_media_access stores the image URL, but I don't see the media's attachment ID being stored in the meta anywhere.
The ID is useful for all kinds of WP functions though - it would be good to have.
Unfortunately I don't know how to add this, but I would like to learn.
The text was updated successfully, but these errors were encountered: