WordPress.org

Ready to get started?Download WordPress

Forums

Add links to non-local files to WP's media library? (1 post)

  1. carbeck
    Member
    Posted 1 year ago #

    For some time, I've been using the File Gallery plugin to dynamically generate lists of uploaded media in my WordPress's media library according to tags. However, it's happened to me that I wanted to also include e.g. a video I uploaded to Youtube or a file I have on Soundcloud to this list. But File Gallery gets all its data from WordPress's built-in media library function/tables.

    Now, to get files to register with your media library in order for WordPress to handle them, you have to upload them to your server, and a record with meta information about this file including the absolute URL to its whereabouts will subsequently be added to the wp_posts table in WordPress's database backend, like this:

    ID: 2055
    post_author: 1
    post_date: 2012-03-15 14:53:51
    post_date_gmt: 2012-03-15 13:53:51
    post_content: NULL
    post_title: Super Awesome Holiday Photo
    post_excerpt: Super Awesome Holiday Photo
    post_status: inherit
    comment_status: open
    ping_status: open
    post_password: NULL
    post_name: photo_1234
    to_ping: NULL
    pinged: NULL
    post_modified: 2012-03-15 14:53:51
    post_modified_gmt: 2012-03-15 13:53:51
    post_content_filtered: NULL
    post_parent: 0
    guid: http://example.com/wp-content/uploads/2012/03/photo_1234.jpg
    menu_order: 0
    post_type: attachment
    post_mimetype: image/jpeg
    comment_count: 0

    I've manually edited the guid field before in PHPMyAdmin so as to include links to some of my Youtube videos so that WordPress could handle these videos as though they were files on my server, so the videos would in turn be listable with File Gallery (and it worked!). However, this strikes me as very inconvenient to do manually every time.

    Which is why I'd like to ask: Is there a plugin to register links to files that are not on your own server with WordPress's database so that they appear in your media library? I've found a plugin once that could do this for Youtube videos specifically, but I'd like to be able to do that generally.

Topic Closed

This topic has been closed to new replies.

About this Topic