public function addRootAdminBar()
    {
        $identifier = $this->getModel()->getIdentifier();
        $options = $this->getModel()->getPages($identifier);

        add_action('admin_bar_menu', function () use ($identifier, $options) {
            global $wp_admin_bar;

            // Add main admin bar
            $wp_admin_bar->add_node([
                'parent'    => '',
                'id'        => $identifier,
                'title'     => $options['title'],
                'href'      => admin_url('admin.php?page='.$identifier),
                'meta'      => false
            ]);
        });
    }
public function addRootAdminBar()
    {
        $identifier = $this->getModel()->getIdentifier();
        $options = $this->getModel()->getPages($identifier);

        add_action('admin_bar_menu', function () use ($identifier, $options) {
            global $wp_admin_bar;

            // Add main admin bar
            $wp_admin_bar->add_node([
                'parent'    => '',
                'id'        => $identifier,
                'title'     => $options['title'],
                'href'      => admin_url('admin.php?page='.$identifier),
                'meta'      => false
            ]);
        });
    }
public function addRootAdminBar ( ) { $ identifier = $ this -> getModel ( ) -> getIdentifier ( ) ; $ options = $ this -> getModel ( ) -> getPages ( $ identifier ) ; add_action ( 'admin_bar_menu' , function ( ) use ( $ identifier , $ options ) { global $ wp_admin_bar ; // Add main admin bar $ wp_admin_bar -> add_node ( [ 'parent' => '' , 'id' => $ identifier , 'title' => $ options [ 'title' ] , 'href' => admin_url ( 'admin.php?page=' . $ identifier ) , 'meta' => false ] ) ; } ) ; }
Add root admin bar page.
Add root admin bar page .