• Resolved slapbox

    (@slapbox)


    I’m wondering if there’s any plugin for, or way to add, file entries automatically when a new file is uploaded into the downloads folder. For example, newer versions of an existing download – it would be great to have these new versions added automatically rather than needing to manually edit the downloads.

    Or is there any API for this plugin?

    • This topic was modified 2 years, 4 months ago by slapbox.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support beatrice12

    (@beatrice12)

    Hello @slapbox,

    Thanks for reaching out to us!

    This is an interesting idea! I opened a ticket with our development team regarding this and we will add it to our roadmap. Here you can see the progress: https://github.com/WPChill/download-monitor/issues/997

    All the best,
    Beatrice.

    Thread Starter slapbox

    (@slapbox)

    Thanks for the reply @beatrice12!

    In the meantime, could you give any hint about how to add a new version to the list of files for a given download item?

    For example, if the download current has listed versions like

    – 1.2
    – 1.1
    – 1.0

    How could we insert a version 1.3 above those?

    Thread Starter slapbox

    (@slapbox)

    To clarify the question, specifically how would we get v1.3 to come above those? I’ve experimented with the code like from the API docs that looks like:

    download_monitor()->service('version_repository')->persist($dummy_entry);
    download_monitor()->service('transient_manager')->clear_versions_transient($dummy_id);

    But the end resulting list in the UI looks like:

    – 1.2
    – 1.1
    – 1.3
    – 1.0

    The newly added item always seems to come second to last, even if the created date and version is larger, and I see persist takes no arguments, so is there some special logic for ordering I’m overlooking?

    I’d be very grateful for a pointer here!

    Thank you again!

    Plugin Support beatrice12

    (@beatrice12)

    Hello @slapbox,

    The order of the versions is set by set_menu_order( $order_nr ); method. Where $order_nr is an integer representing the order in which the versions appear on the download.

    Warmly,
    Beatrice.

    • This reply was modified 2 years, 3 months ago by beatrice12.
    Thread Starter slapbox

    (@slapbox)

    Thanks so much for the tip!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Any way to programmatically add entries for files uploaded via FTP?’ is closed to new replies.