wip i broke everyhting :p

This commit is contained in:
asus
2024-03-14 13:10:05 +01:00
parent 76f2e8ba00
commit e14acfb739
7 changed files with 18 additions and 121 deletions

View File

@@ -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);