The add_menu_page function is very similar to the add_options_page function seen in the previous recipe, with its first five parameters being identical:
add_menu_page( $page_title, $menu_title, $capability,
$menu_slug, $function, $icon_url, $position );
The last two items are specific to this function, with the first allowing us to display a custom icon in the menu next to our new top-level item, and the second specifying where the new menu should be positioned within the administration menu.
Once the first menu item has been created, the add_submenu_page function can be used to attach a submenu item. The following are its parameters, which are virtually identical to the add_options_page function, except for the first parameter, which should be the unique string identifier of the top-level menu item to which the submenu should be attached:
add_submenu_page( $parent_slug, $page_title, $menu_title,
$capability, $menu_slug, $function );
While it is possible to use this technique to create top-level menu items for plugins with a single configuration page, these simpler extensions should create a single entry under the Settings menu, as shown in the previous recipe.