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.
Thread Starter
kaiwen
(@kaiwen)
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.
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 6 years, 5 months ago by
dragogio.