• Resolved Julian M.

    (@jmagnone)


    Hi,

    I’d like to know if there is any way to add certain actions or hooks after an upload is made via wp-admin to WP Download Manager. In particular, I am interested to process the upload file and convert it to another format automatically. I tried to search for do_action in the source code but unfortunately could not find such option.

    Any ideas if this kind of hooks can be added in future releases of the plugin?

    https://ww.wp.xz.cn/plugins/wp-downloadmanager/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Lester Chan

    (@gamerz)

    Just would like to confirm you are referring to this plugin? Because the way you type the plugin name can means https://ww.wp.xz.cn/plugins/download-manager/ as well.

    I have way too many cases of wrong plugin.

    Thread Starter Julian M.

    (@jmagnone)

    Hi Lester.
    Thank you for your promptly response. Yes, I am referring to this plugin. I understand there is another plugin with similar name and may lead to some confusion. I am using your plugin in some of my websites.

    To be more specific about what I need. I’d like to be able to run certain actions when there is a new upload. Ideally, this could be done via an add_action in your plugin passing information about the uploaded file that is ready for use in WP. For example, once an upload is performed, I’d like to send a request to another 3rd party app to run a conversion process (if it is a .ppt file then I will generate the slide thumbnails), if it is a video then I will convert it or publish to Youtube, etc., once it is finish I’d publish a new page with the download, a thumbnail and a few additional info.

    Looking forward for your comments.

    Plugin Author Lester Chan

    (@gamerz)

    That sounds good, added a GitHub issue so that I can do it when I am free https://github.com/lesterchan/wp-downloadmanager/issues/8

    Thread Starter Julian M.

    (@jmagnone)

    Sounds great. I will try to elaborate a little bit as soon as I could check further to the source code, but after a quick check I am under the impression that it could be added to download-add.php below the $addfile variable where you insert the row in DB.

    All these fields you insert into the DB can be helpful to have in in an action (maybe wrapped in an array) so after calling do_action(‘wpdm_download_added’, ‘…’) we can get the file info (file size, where physically it is saved or if it is a remote file, date, etc.).

    Thread Starter Julian M.

    (@jmagnone)

    Hi Lester, is there any chance you could add this hook in any upcoming update of the plugin ? Just following up,sorry. I have some coded added by myself, but I am worried about future updates that won’t break my custom code that I added.

    Plugin Author Lester Chan

    (@gamerz)

    Why don’t you fork the plugin and submit a pull request of those hooks you added? This makes it easier for me

    I would prefix the hook name to be wp_downloadmanager_

    Thread Starter Julian M.

    (@jmagnone)

    Definitely. Good idea, I will do it.
    Julian

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Do Action and Hooks for Uploads’ is closed to new replies.