这不是你问题的直接答案。我个人认为,即使有可能,以你想要的方式去做也可能是不明智的。如果你懂一点编程,那么你可以使用下面的一页插件来实现你想要的。
<?php
/**
* Plugin Name: Limit User Access To Pages
*/
defined(\'ABSPATH\') or die("No script kiddies please!");
function RestrictPageAccessToUsers()
{
/**
* Global Intializations
*/
global $current_user;
get_currentuserinfo();
global $post;
/**
* @var array $usersToRedirect Contains user IDs that
* should be restricted to enter $pageToRestrict
*/
$usersToRedirect = array(2, 3);
/**
* @var array $pagesToRestrict Contains post (page) IDs
* that should be restricted for $usersToRedirect
*/
$pagesToRestrict = array(14);
/**
* @var string $redirectUrl Contains link where the user
* should be redirected if it is not allowed to access
* the page.
*/
$redirectUrl = home_url();
if (in_array($current_user->ID, $usersToRedirect) === true && in_array($post->ID, $pagesToRestrict) === true) {
wp_redirect( $redirectUrl );
exit();
}
}
add_action( \'template_redirect\', \'RestrictPageAccessToUsers\' );
您需要在这个插件中配置三件事。这些是:-
$usersToRedirect
$pagesToRestrict
$redirectUrl