In WordPress, the main navigation menu is located on the left-hand side of the screen where we have access to all the sections of the application. In a similar way to the admin toolbar, we have the ability to extend the main navigation menu with customized versions.
Let's start by adding the admin menu invoking an action to the constructor:
add_action('admin_menu',array( $this,'customize_main_navigation') );
Now, consider the initial implementation of the customize_main_navigation function:
public function customize_main_navigation(){
global $menu,$submenu;
echo "<pre>";print_r($menu);echo "</pre>";exit;
}
The preceding code uses the global variable menu for accessing the available main navigation menu items. Before we begin the customizations, it's important to get used to the structure...