GC_Admin_Bar::_render()

最后更新于:2021-11-26 09:09:59

GC_Admin_Bar::_render( object$root)

参数

$root

(object) (Required)

源文件

文件: gc-includes/class-gc-admin-bar.php

	final protected function _render( $root ) {
		// Add browser classes.
		// We have to do this here since admin bar shows on the front end.
		$class = 'nojq nojs';
		if ( gc_is_mobile() ) {
			$class .= ' mobile';
		}

		?>
		<div id="gcadminbar" class="<?php echo $class; ?>">
			<?php if ( ! is_admin() && ! did_action( 'gc_body_open' ) ) { ?>
				<a class="screen-reader-shortcut" href="https://https://docs.gechiui.com/" tabindex="1"><?php _e( 'Skip to toolbar' ); ?></a>
			<?php } ?>
			<div class="quicklinks" id="gc-toolbar" role="navigation" aria-label="<?php esc_attr_e( 'Toolbar' ); ?>">
				<?php
				foreach ( $root->children as $group ) {
					$this->_render_group( $group );
				}
				?>
			</div>
			<?php if ( is_user_logged_in() ) : ?>
			<a class="screen-reader-shortcut" href="https://docs.gechiui.com/classes/gc_admin_bar/_render/<?php echo esc_url( gc_logout_url() ); ?>"><?php _e( 'Log Out' ); ?></a>
			<?php endif; ?>
		</div>

		<?php
	}