From f431417fd1db6766212aea913f5238025a36b98c Mon Sep 17 00:00:00 2001 From: James Cocker Date: Thu, 9 Sep 2021 18:18:47 +0100 Subject: [PATCH] Update README.md Added canEdit check in BetterNavigatorEditLink example. Co-authored-by: Jono Menz --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 136218a..36fb3d0 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,8 @@ There may be occasions when you wish to override the "Edit in CMS" link. For exa */ public function BetterNavigatorEditLink() { - return CMSEditLinkAPI::find_edit_link_for_object($this->displayedEvent()); + $event = $this->displayedEvent(); + return $event->canEdit() ? CMSEditLinkAPI::find_edit_link_for_object($event) : false; } ````