PHP code example of underpin / admin-bar-menu-loader

1. Go to this page and download the library: Download underpin/admin-bar-menu-loader library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

underpin / admin-bar-menu-loader example snippets


\Underpin\underpin()->admin_bar_menus()->add( 'menu_bar_key', [
	'children'    => [],
	'capability'  => 'administrator',
	'id'          => 'menu_bar_id', // Required
	'args'        => [ /* See WP_Admin_Bar::add_menu */ ],
	'position'    => 200,
	'name'        => 'Menu Bar',
	'description' => 'A menu bar example',
] );

underpin()->admin_bar_menus()->add('menu_bar-key','Namespace\To\Class');