From 6119e8d566ff21f822ef3ea83bfa521db6972de7 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Wed, 1 Nov 2023 10:05:30 -0400 Subject: [PATCH] Explain how to remove a child item using the new third param of the `remove()` method. --- content/collections/extending-docs/cp-navigation.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/content/collections/extending-docs/cp-navigation.md b/content/collections/extending-docs/cp-navigation.md index cf044385c..4a1f0cda6 100644 --- a/content/collections/extending-docs/cp-navigation.md +++ b/content/collections/extending-docs/cp-navigation.md @@ -119,7 +119,7 @@ Nav::extend(function ($nav) { ## Removing Items -To remove an item, we only need to specify the section and item name: +To remove an item, we may specify the section and item name: ```php Nav::extend(function ($nav) { @@ -127,6 +127,14 @@ Nav::extend(function ($nav) { }); ``` +To remove a child of an item, we can pass a third param to specify the child's name: + +```php +Nav::extend(function ($nav) { + $nav->remove('Content', 'Collections', 'Products'); +}); +``` + To remove an entire section, we only need to specify the section name: ```php