Adds a group to a toolbar menu node.
Description
Groups can be used to organize toolbar items into distinct sections of a toolbar menu.
Parameters
$args
arrayrequired- Array of arguments for adding a group.
id
stringID of the item.parent
stringOptional. ID of the parent node. Default'root'
.meta
arrayMeta data for the group including the following keys:'class'
,'onclick'
,'target'
, and'title'
.
Source
final public function add_group( $args ) {
$args['group'] = true;
$this->add_node( $args );
}
Changelog
Version | Description |
---|---|
3.3.0 | Introduced. |
Adding a group to a parent node
This example adds a parent node, child nodes and a group to the toolbar.
The output from this example in the toolbar will be: