Support » Plugin: Redirect to page if not logged in » How to use this plugin

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Rafa Poveda

    (@bi0xid)

    Sorry, Kaiwen, for answering so late.

    It was a very concrete implementation for a client and I’m now working in the settings page. It will be working soon.

    Thanks Rafa!
    I’ve been looking for a plugin like this forever – just a simple redirection plugin to redirect visitors to a maintenance page.

    I’ve tried using other plugins like this one but they never work.

    alexlii

    (@alexlii)

    Great,

    how to custom the page which should be redirect to?
    It would be much better if it support to custom a redirect URL

    Thanks a lot.

    Alex

    I suggest to implement a different redirect for each unallowed page.
    Something like this (NOT tested, i’m NOT a PHP skilled dev):

    
    if ( is_user_logged_in() ) {
        return;
    }
    
    // TODO admin page to manage unallowed pages and redirect to urls
    $unallowed_pages = array(345,          234,         732); // pages ID
    $redirect_to =     array('/firstURL/', 'secondULR', 'thirdURL');
    
    $queried = get_queried_object_id();
    $found_at_index = array_search($queried, $unallowed_pages , true);
    if ( !$found_at_index ) {
        return;
    }
    
    wp_redirect( site_url( $redirect_to[$found_at_index] ) );
    exit();
    
    • This reply was modified 1 year, 9 months ago by  dragogio.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to use this plugin’ is closed to new replies.