• Resolved doanthaoan

    (@doanthaoan)


    Hello,

    Thank you for your nice plugin.
    I installed it and it work really well at first. But after I install Polylang for multiple language support, files can’t be downloaded because permalink structure of Download Monitor didn’t add the language part:
    Current link structure: http://domain.ltd/download/id => doesn’t work
    Needed link structure: http://domain.ltd/language-slug/download/id

    How can I add the language segment into download link?

    Any ideas id appreciated. Thanks in advance!

    An Doan.

Viewing 1 replies (of 1 total)
  • Thread Starter doanthaoan

    (@doanthaoan)

    I found a walkaround for working with Polylang like this:
    Edit download-monitor/includes/class-dlm-download.php
    Search function: public function get_the_download_link()
    Replace:
    $endpoint = ( $endpoint = get_option( 'dlm_download_endpoint' ) ) ? $endpoint : 'download';
    with this:
    $endpoint = ( $endpoint = get_option( 'dlm_download_endpoint' ) ) ? pll_current_language().'/'.$endpoint : pll_current_language().'/'.'download';

    In short, just rebuild the link with current polylang language. This one only work with Polylang.
    I hope someone will find out better solution for this. And please share with me.

    Thank you.
    An Doan

    • This reply was modified 7 years, 1 month ago by doanthaoan.
Viewing 1 replies (of 1 total)
  • The topic ‘Endpoint does not work with Polylang’ is closed to new replies.