WordPress.org

Ready to get started?Download WordPress

Forums

Download Monitor
[resolved] Redirecting non-logged in users (6 posts)

  1. jt70
    Member
    Posted 7 months ago #

    In the legacy version, I recall being able to send guests to a specific page if they were not logged in. I don't see that same function on this version. Am I just missing it or is that functionality gone?

    Thanks,
    Jeff

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

  2. exhtml
    Member
    Posted 7 months ago #

    Hi! was wondering exactly the same, and think that in new version you have to use filters:
    https://github.com/mikejolley/download-monitor/wiki/Action-and-filter-reference
    Concretely: dlm_access_denied_redirect - Return a url to redirect somewhere if the user cannot access a file. Default is false.
    Haven't tested yet but I figure that the use would be similar to the one explained here:
    https://github.com/mikejolley/download-monitor/wiki/do_not_force-filter

    Anyway would be nice if Mike could confirm it!

  3. mikejolley
    Member
    Plugin Author

    Posted 7 months ago #

    dlm_access_denied_redirect is indeed the filter you need to use. Return a URL, e.g.

    add_filter( 'dlm_access_denied_redirect', 'my_access_denied_redirect' );
    
    function my_access_denied_redirect() {
    return "http://yoursite.com/somepage";
    }
  4. jt70
    Member
    Posted 7 months ago #

    Brilliant! Works like a champ.
    Thanks for the help.
    Jeff

  5. Jo Couchman
    Member
    Posted 6 months ago #

    Thanks for this.
    What about keeping the "You do not have permission...' screen but changing the wording and the redirect link provided?

  6. muhamed.fejziu
    Member
    Posted 3 months ago #

    where to add this code?

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.