WP_Admin_Bar::add_node

SummerySummery

Adds a node to the menu.

Syntax

WP_Admin_Bar::add_node( array $args )

ParametersParameters

$args

(array) (Required) Arguments for adding a node.

  • 'id'
    (string) ID of the item.
  • 'title'
    (string) Title of the node.
  • 'parent'
    (string) Optional. ID of the parent node.
  • 'href'
    (string) Optional. Link for the item.
  • 'group'
    (bool) Optional. Whether or not the node is a group. Default false.
  • 'meta'
    (array) Meta data including the following keys: 'html', 'class', 'rel', 'lang', 'dir', 'onclick', 'target', 'title', 'tabindex'. Default empty.

SourceSource

File: wp-includes/class-wp-admin-bar.php


			

ChangelogChangelog

Changelog
Version Description
4.5.0 Added the ability to pass 'lang' and 'dir' meta data.
3.1.0 Introduced.
Scroll to Top