Code Duplication    Length = 8-12 lines in 2 locations

src/wp-includes/admin-bar.php 2 locations

@@ 350-361 (lines=12) @@
347
			) );
348
		}
349
350
	} else if ( current_user_can( 'read' ) ) {
351
		// We're on the front end, link to the Dashboard.
352
		$wp_admin_bar->add_menu( array(
353
			'parent' => 'site-name',
354
			'id'     => 'dashboard',
355
			'title'  => __( 'Dashboard' ),
356
			'href'   => admin_url(),
357
		) );
358
359
		// Add the appearance submenu items.
360
		wp_admin_bar_appearance_menu( $wp_admin_bar );
361
	}
362
}
363
364
/**
@@ 537-544 (lines=8) @@
534
			'href'   => admin_url(),
535
		) );
536
537
		if ( current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {
538
			$wp_admin_bar->add_menu( array(
539
				'parent' => $menu_id,
540
				'id'     => $menu_id . '-n',
541
				'title'  => __( 'New Post' ),
542
				'href'   => admin_url( 'post-new.php' ),
543
			) );
544
		}
545
546
		if ( current_user_can( 'edit_posts' ) ) {
547
			$wp_admin_bar->add_menu( array(