• I’m doing a mass import of documents from a legacy system, so I need a way to programmatically add dlm_download posts. I can’t find a single function to do this, which would create the dlm_download and handle the file attachment too. The process seems to be wrapped up inside DLM_Admin_Media_Insert::media_browser(), but not in such a way as to be used by a script in another plugin / theme.

    Am I missing something or should I be writing my own script based on this code?

    https://wordpress.org/plugins/download-monitor/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Barry Kooij

    (@barrykooij)

    Hey Steve,

    Did you see we have an migration extension for this? https://www.download-monitor.com/extensions/dlm-legacy-importer/

    Kind Regards,

    Barry Kooij

    Thread Starter Steve Taylor

    (@gyrus)

    Hi Barry,

    Just got back to this issue after a long hiatus working on other aspects. Thanks for the reply – but am I missing something? The extension you pointed to seems to be about conversion from a legacy version of the DLM plugin. When I said ‘legacy system’, I meant it generally, i.e. a completely non-WP system.

    The issue of programmatically adding DLM downloads also comes up in relation to this issue, which I didn’t get a response from (neither from yourselves nor the author of the Comment Attachment plugin):

    https://wordpress.org/support/topic/integration-with-download-monitor?replies=2

    Without a response, all I can do is fork Comment Attachment. But obviously I need to be able to rewrite the code there to import the attached file as a DLM download rather than a plain media library file.

    So I need to be able to programmatically add a DLM post to (1) import a large amount of files from a legacy non-WP system, and (2) to just add a new file uploaded on the front end.

    Cheers,

    Steve

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘proper way to programmatically add download’ is closed to new replies.