wip i broke everyhting :p
This commit is contained in:
@@ -15,17 +15,8 @@ function restrict_author_page_CIPF() {
|
||||
$role_fipf = PLGNTLS_class::ROLE_FIPF;
|
||||
$role_admin = PLGNTLS_class::ROLE_ADMIN;
|
||||
|
||||
$slug = get_post_field( 'post_name', get_post() );
|
||||
error_log("slug");
|
||||
error_log($slug);
|
||||
// error_log("request");
|
||||
// error_log(json_encode($_REQUEST));
|
||||
// error_log("server");
|
||||
// error_log(json_encode($_SERVER));
|
||||
|
||||
if (!is_author())
|
||||
return;
|
||||
PLGNTLS_class::debug_infos();
|
||||
|
||||
$current_user = wp_get_current_user();
|
||||
|
||||
@@ -38,7 +29,6 @@ PLGNTLS_class::debug_infos();
|
||||
$allowed_roles = array($role_admin, $role_fipf);
|
||||
if (array_intersect($allowed_roles, $current_user->roles))
|
||||
return;
|
||||
PLGNTLS_class::debug_infos();
|
||||
|
||||
/*
|
||||
* get_queried_object_id() would work too
|
||||
@@ -56,7 +46,6 @@ PLGNTLS_class::debug_infos();
|
||||
wp_redirect(home_url(), 301);
|
||||
exit;
|
||||
}
|
||||
PLGNTLS_class::debug_infos();
|
||||
}
|
||||
add_action('template_redirect', 'restrict_author_page_CIPF', 10);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user