Support » Fixing WordPress » Retrieve ID of an image by URL and store as featured image then

  • Dear all,

    I was asked to setup a new theme on an existing blog. The blog contains 1500++ articles. Each article has a custom meta field, which contains an URL to an image, which was uploaded with the media uploader.

    I need to build a short script, which walks through any article, fetches the URL from the custom field, searches the ID this URL correspondents to in the database. As final step the script should connect this (attachment) ID as featured image of the article.

    Am I right, that:
    1.) Images uploaded with media uploader are stored in wp_posts as type attachment?
    2.) the ID of that line in wp_posts is the ID which is used to store the featured image relation to a article post?

    Questions:
    1.) Where is that relation article <> featured image stored?
    2.) In which way is it stored – whats the logic?
    3.) What additional data is required in the relation table?

    Thank You very much,
    Thomas

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Retrieve ID of an image by URL and store as featured image then’ is closed to new replies.