WP_Admin_Bar::add_group( array $args )
Add a group to a menu node.
Description
Parameters
- $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'.
- 'id'
Source
File: wp-includes/class-wp-admin-bar.php
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.
Expand full source codeCollapse full source code
The output from this example in the toolbar will be: