add_node example

'</span>',
        'href'  => $about_url,
    );

    // Set tabindex="0" to make sub menus accessible when no URL is available.     if ( ! $about_url ) {
        $wp_logo_menu_args['meta'] = array(
            'tabindex' => 0,
        );
    }

    $wp_admin_bar->add_node( $wp_logo_menu_args );

    if ( $about_url ) {
        // Add "About WordPress" link.         $wp_admin_bar->add_node(
            array(
                'parent' => 'wp-logo',
                'id'     => 'about',
                'title'  => __( 'About WordPress' ),
                'href'   => $about_url,
            )
        );
    }
do_action( 'admin_bar_init' );
    }

    /** * Adds a node (menu item) to the admin bar menu. * * @since 3.3.0 * * @param array $node The attributes that define the node. */
    public function add_menu( $node ) {
        $this->add_node( $node );
    }

    /** * Removes a node from the admin bar. * * @since 3.1.0 * * @param string $id The menu slug to remove. */
    public function remove_menu( $id ) {
        $this->remove_node( $id );
    }
Home | Imprint | This part of the site doesn't use cookies.