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.

Метод класса: WP_Admin_Bar{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$WP_Admin_Bar = new WP_Admin_Bar();
$WP_Admin_Bar->add_group( $args );
$args(массив) (обязательный)

Array of arguments for adding a group.

  • id(строка)
    ID of the item.

  • parent(строка)
    Optional. ID of the parent node.
    По умолчанию: 'root'

  • meta(массив)
    Meta data for the group including the following keys: 'class', 'onclick', 'target', and 'title'.

Список изменений

С версии 3.3.0 Введена.

Код WP_Admin_Bar::add_group() WP 6.2

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

	$this->add_node( $args );
}