• I have decided to have one last try at asking for help on here, all my previous posts have gone un answered…

    When you upload a file (such as a photo) you give it a description, even if the file is never used in a post wordpress still keeps the description, so where is it kept? I’ve browsed through the database and carnt see it anywhere. I’m confused about where it is kept

    Why do i want it?
    I’m looking into the possibility of displaying all photos uploaded by a particular author on there author template.

Viewing 4 replies - 1 through 4 (of 4 total)
  • hmm, that’s a really good question.

    I think it’s in wp_postMeta with keys of “_wp_attached_file” and “_wp_attachment_metadata” (where “wp_” is your table prefix)

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Attachments (files you upload through the inline uploader) are actually saved as posts. The file is saved off to the normal location, of course, but a new entry is created in the posts table with all the information about this attachment. The Description is stored as the post_content. These posts have a post_status of “attachment” instead of the more normal “publish” and such.

    Look at the wp_insert_attachment() function for details on where and how all this stuff is saved. Also look at inline-uploading.php which is the script that the file is actually uploaded to and which handles the processing of the file. Or just do a SELECT * FROM wp_posts WHERE post_status = “attachment”; and look at what you get back. These attachments do have the author name and such, as well as the filename, so finding which attachments any particular author uploaded should be easy enough there.

    So Otto, what’s the stuff I found? Related meta or was I completely off base?

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    _wp_attached_file holds the filename of the file in question, and it is metadata that is actually linked to this fake post.

    _wp_attachment_metadata is only there for image files that you upload, appearantly. It is also linked to this fake post, and it appears to be an array holding image related information. Width, height, location of the thumbnail image, a thing called “hwstring_small” which appears to have the width and height of the thumbnail image, etc…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Where is image description stored in WP2.0?’ is closed to new replies.