Download Monitor
[resolved] Redirection filter if not 'Members' (3 posts)

  1. vdowsett
    Posted 2 years ago #

    For the website I'm working on only those who are logged in should be able to download items. If they are not logged in, I'd like to send them to a customer url to ask them to either log in or register.

    I'm trying to apply the filter to redirect users to the other url rather than the current download error page if they are not logged in. (just the login url for now, but a custom page later) I'm no expert, was hoping to get advice on the correct code to use in my functions file.

    $download_url = wp_login_url();
    $redirect = apply_filter( 'dlm_access_denied_redirect', true, $download_url );


  2. Josh
    Posted 2 years ago #

    Use this in your functions.pho file:

    /** Downloads Monitor redirection to login page for non-logged in members trying to download content */
    function redirection() {
        $redirected_url = $_SERVER['HTTP_REFERER'];
        $download_url = $_SERVER['REQUEST_URI'];
        $download_redirect = urlencode("{$redirected_url}?redirect-to={$download_url}");
        return "YOUR_URL_HERE";
    // filter calls
  3. vdowsett
    Posted 2 years ago #

    Hi, that did the trick, thank you so much for your assistance!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Download Monitor
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic