WP_Admin_Bar::_render_group() WordPress Method

The WP_Admin_Bar::_render_group() method is used to render a group of admin bar menu items. This method is used internally by the WP_Admin_Bar::render() method, so you should not need to call it directly.

WP_Admin_Bar::_render_group( object $node ) #


Parameters

$node

(object)(Required)


Top ↑

Source

File: wp-includes/class-wp-admin-bar.php

	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>';
	}


Top ↑

Changelog

Changelog
VersionDescription
3.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.