WP_Admin_Bar::add_group()publicWP 3.3.0

Adds a group to a toolbar menu node.

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

Method of the class: WP_Admin_Bar{}

No Hooks.

Return

null. Nothing (null).

Usage

$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'.

Changelog

Since 3.3.0 Introduced.

WP_Admin_Bar::add_group() code WP 6.6.2

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

	$this->add_node( $args );
}