# New custom link

**URL:** <https://community.mainwp.com/t/new-custom-link/2012>\
**Category:** UX\
**Tags:** menu-item\
**Created:** [October 7, 2020, 1:45pm UTC](https://community.mainwp.com/t/new-custom-link/2012 "2020-10-07T13:45:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cad861](https://community.mainwp.com/letter_avatar_proxy/v4/letter/c/e56c9b/32.png) [@cad861](https://community.mainwp.com/u/cad861)\
**Post date:** [October 7, 2020, 1:45pm UTC](https://community.mainwp.com/t/new-custom-link/2012/1 "2020-10-07T13:45:26Z")

</div>

Hi all,  
Looking at the custom dashboard extension and wondered if anyone has added additional items to the dashboard admin menu using the PHP section?

I.e. Adding an external link say under the Overview item.  
Thanks

---

<div class="post-metadata">

**Author:** ![bogdan](https://community.mainwp.com/user_avatar/community.mainwp.com/bogdan/32/11_2.png) [@bogdan](https://community.mainwp.com/u/bogdan)\
**Post date:** [October 7, 2020, 6:57pm UTC](https://community.mainwp.com/t/new-custom-link/2012/2 "2020-10-07T18:57:54Z")

</div>

Hi Chris,

Here is an example snippet you can adjust to your needs:

```auto
add_filter( 'mainwp_main_menu', 'mycustom_mainwp_main_menu', 10, 1 );
function mycustom_mainwp_main_menu( $left_menu ) {
        $index = 1;
		$sub_menu_before = array_slice( $left_menu['mainwp_tab'], 0, $index );
		$sub_menu_after = array_splice( $left_menu['mainwp_tab'], $index );
		$addition_item = array();
		$addition_item[] = 'Addition item';
		$addition_item[] = 'addition-item';
		$addition_item[] = 'admin.php?page=addition-item';
		$left_menu['mainwp_tab'][] = $addition_item;
		$left_menu['mainwp_tab'] = array_merge( $left_menu['mainwp_tab'], $sub_menu_after );
		return $left_menu;
}

```

Here you can find the hook reference:

> **[mainwp\_main\_menu](https://mainwp.dev/hooks/mainwp_main_menu/)**
>
> Filters main navigation menu items

Let me know how it goes.

---

<div class="post-metadata">

**Author:** ![cad861](https://community.mainwp.com/letter_avatar_proxy/v4/letter/c/e56c9b/32.png) [@cad861](https://community.mainwp.com/u/cad861)\
**Post date:** [October 7, 2020, 8:15pm UTC](https://community.mainwp.com/t/new-custom-link/2012/3 "2020-10-07T20:15:04Z")

</div>

Perfect thank you @bogdan for this.

---

<div class="post-metadata">

**Author:** ![bogdan](https://community.mainwp.com/user_avatar/community.mainwp.com/bogdan/32/11_2.png) [@bogdan](https://community.mainwp.com/u/bogdan)\
**Post date:** [October 7, 2020, 8:15pm UTC](https://community.mainwp.com/t/new-custom-link/2012/4 "2020-10-07T20:15:35Z")

</div>

You are very welcome.

---

<div class="post-metadata">

**Author:** ![system](https://community.mainwp.com/uploads/default/original/2X/4/4cfc87ac67e4ebdbfa0bbf0b19c8657f35a29a5b.png) [@system](https://community.mainwp.com/u/system)\
**Post date:** [October 8, 2020, 8:15pm UTC](https://community.mainwp.com/t/new-custom-link/2012/5 "2020-10-08T20:15:40Z")

</div>

Closed on October 8, 2020, 8:15pm UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
