Handling Media Uploads in code
-
Hello all.
I’m moving news items from a custom CMS into WordPress. In order to do it, I’ve been hacking the default rss-upload plugin to my needs.
I’ve added a section to it to extract the image links from the posts being read in, fetch the images from the old site and save them into WP using wp_upload_bits(), before modifying the link to point to the new location. All works well except for one point – is there any way of calling the full WordPress media upload routine so that the images get added to the Media Library? There are several hundred of them, and many get reused regularly in posts, and will be called upon again.
I started trying to recreate this routine manually when I couldn’t find a way of doing it, but that path looks to be riddled with pitfalls, since media items are stored in the wp_posts table in the DB.
Thanks,
- The topic ‘Handling Media Uploads in code’ is closed to new replies.