Code Duplication    Length = 8-12 lines in 2 locations

wp-includes/admin-bar.php 2 locations

@@ 329-340 (lines=12) @@
326
			) );
327
		}
328
329
	} else if ( current_user_can( 'read' ) ) {
330
		// We're on the front end, link to the Dashboard.
331
		$wp_admin_bar->add_menu( array(
332
			'parent' => 'site-name',
333
			'id'     => 'dashboard',
334
			'title'  => __( 'Dashboard' ),
335
			'href'   => admin_url(),
336
		) );
337
338
		// Add the appearance submenu items.
339
		wp_admin_bar_appearance_menu( $wp_admin_bar );
340
	}
341
}
342
343
/**
@@ 485-492 (lines=8) @@
482
			'href'   => admin_url(),
483
		) );
484
485
		if ( current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {
486
			$wp_admin_bar->add_menu( array(
487
				'parent' => $menu_id,
488
				'id'     => $menu_id . '-n',
489
				'title'  => __( 'New Post' ),
490
				'href'   => admin_url( 'post-new.php' ),
491
			) );
492
		}
493
494
		if ( current_user_can( 'edit_posts' ) ) {
495
			$wp_admin_bar->add_menu( array(