public function addMyCustomMenuItem($observer) { $menu = $observer -> getMenu(); $menu -> getChild() -> add( 'my_custom_menu_item', array( 'label' => 'My Custom Menu Item', 'url' => 'https://example.com', 'class' => 'my-custom-class' ), -1 ); }In this example, we create a custom menu item with the label "My Custom Menu Item", URL "https://example.com", and a custom class "my-custom-class". The -1 value specifies the position of the menu item in the menu hierarchy. This code should be placed in your Magento module's observer file. The Varien_Event_Observer object is part of the Magento Core library package.