WP_Admin_Bar::_render_group()protectedWP 3.3.0

Method of the class: WP_Admin_Bar{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->_render_group( $node );
$node(object) (required)
-

Changelog

Since 3.3.0 Introduced.

WP_Admin_Bar::_render_group() code WP 6.4.3

final protected function _render_group( $node ) {
	if ( 'container' === $node->type ) {
		$this->_render_container( $node );
		return;
	}
	if ( 'group' !== $node->type || empty( $node->children ) ) {
		return;
	}

	if ( ! empty( $node->meta['class'] ) ) {
		$class = ' class="' . esc_attr( trim( $node->meta['class'] ) ) . '"';
	} else {
		$class = '';
	}

	echo "<ul id='" . esc_attr( 'wp-admin-bar-' . $node->id ) . "'$class>";
	foreach ( $node->children as $item ) {
		$this->_render_item( $item );
	}
	echo '</ul>';
}