WordPress at a glance
function is not described

WP_Admin_Bar::add_group() public WP 3.3.0

Add a group to a toolbar menu node.

Groups can be used to organize toolbar items into distinct sections of a toolbar menu.

{} It's a method of the class: WP_Admin_Bar{}

No Hooks.


null. Nothing.


$WP_Admin_Bar = new WP_Admin_Bar();
$WP_Admin_Bar->add_group( $args );
$args(array) (required)

Array of arguments for adding a group.

  • id(string)
    ID of the item.

  • parent(string)
    Optional. ID of the parent node.
    Default: 'root'

  • meta(array)
    Meta data for the group including the following keys: 'class', 'onclick', 'target', and 'title'.


Since 3.3.0 Introduced.

Code of WP_Admin_Bar::add_group() WP 5.7.2

final public function add_group( $args ) {
	$args['group'] = true;

	$this->add_node( $args );