您应该在前端进行验证,以查看用户是否具有“pro 1”、“pro 2”或其他角色。
Like:
$user = wp_get_current_user();
if (in_array( \'pro-1\', $user->roles)):
//whats this user can see
elseif (in_array( \'pro-2\', $user->roles)):
//whats this user can see
else :
endif;
If you are using a template, you can try adding this on the top of your code:
global $authordata;
global $post;
setup_postdata( $authordata );