{"id":4581198,"date":"2014-02-05T20:08:31","date_gmt":"2014-02-05T20:08:31","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/link-files-in-media-library\/"},"modified":"2016-08-21T15:32:02","modified_gmt":"2016-08-21T15:32:02","slug":"link-files-in-media-library","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/link-files-in-media-library\/","title":{"rendered":"Link files in Media library?"},"content":{"rendered":"<p>Any idea how to link files in the media library?<\/p>\n<p>I&#8217;m trying to attach these files to the post\/page where they were uploaded and it seems like a first step would be to link them to the media library. Right now they are in a separate folder and invisible to the library.<\/p>\n<p>Any ideas? <\/p>\n<p>I&#8217;m trying to use this : http:\/\/cube3x.com\/2013\/03\/upload-files-to-wordpress-media-library-using-php\/  <\/p>\n<p>wp_insert_attachment()  and add it in the UploadHandler.php or the plugin php file. <\/p>\n<p>I&#8217;m doing something wrong as I get Json errors.<\/p>\n<p>This is the handler: <a href=\"http:\/\/botashop.ro\/jquery\/1.txt\">Handler<\/a> <\/p>\n<p>This is the main php file: <a href=\"http:\/\/botashop.ro\/jquery\/2.txt\">Main php<\/a> <\/p>\n<p>Any help is appreciated<\/p>\n<p>https:\/\/wordpress.org\/plugins\/jquery-html5-file-upload\/<\/p>\n","protected":false},"template":"","class_list":["post-4581198","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4581198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4581198\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=4581198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}