Skip to content

Commit

Permalink
fix: only hide edit link on root site pages
Browse files Browse the repository at this point in the history
  • Loading branch information
SteelWagstaff committed Dec 18, 2024
1 parent 7159fd6 commit 9eddba6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Services/PermissionsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ public function setupFilters(): void

do_action('pb_institutional_filters_created', $institution, $institutionalManagers, $institutionalUsers);

// Hide the edit link on the front end for institutional managers
// Hide the edit link on root site pages for institutional managers
add_filter('edit_post_link', function ($link) use ($institution) {
// If the user is a regular super admin, return the link
if ($institution === 0) {
return $link;
}
return '';
$currentBlogId = get_current_blog_id();
if ($currentBlogId === 1 && $institution !== 0) {
return '';
}
else return $link;
});
}

Expand Down

0 comments on commit 9eddba6

Please sign in to comment.