Category for attachments

Hi,

I hope you can help me with one thing.

A long time ago you gave me the following code to add the category to my media files:

// ADD CATEGORY TO ATTACHEMNTS
function wptp_add_categories_to_attachments() {
register_taxonomy_for_object_type( ‘category’, ‘attachment’ );
}
add_action( ‘init’ , ‘wptp_add_categories_to_attachments’ );

This works perfect. So I can add (for example) a media file to the category “USA”.

What I haven’t found so far is where this information is stored in the database? I searched within the tables posts and postmeta , but couldn’t find the entry anywhere. Did you know where I can found this in my database?

Michael

Can you tell me where I can founf the data

Hello Michael,

Thanks for writing in!

All the data for categories and tags can be found in wp_terms, wp_term_taxonomy and wp_term_relationship table in your database. You will only find the text entry in wp_term.

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.