Code Duplication    Length = 34-34 lines in 2 locations

projects/plugins/jetpack/modules/masterbar/masterbar/class-masterbar.php 2 locations

@@ 1066-1099 (lines=34) @@
1063
		}
1064
1065
		// Testimonials.
1066
		if ( Jetpack::is_module_active( 'custom-content-types' ) && get_option( 'jetpack_testimonial' ) ) {
1067
			$testimonials_title = $this->create_menu_item_pair(
1068
				array(
1069
					'url'   => Redirect::get_url( 'calypso-list-jetpack-testimonial' ),
1070
					'id'    => 'wp-admin-bar-edit-testimonial',
1071
					'label' => esc_html__( 'Testimonials', 'jetpack' ),
1072
				),
1073
				array(
1074
					'url'   => Redirect::get_url( 'calypso-edit-jetpack-testimonial' ),
1075
					'id'    => 'wp-admin-bar-new-testimonial',
1076
					'label' => esc_html_x( 'Add', 'Button label for adding a new item via the toolbar menu', 'jetpack' ),
1077
				)
1078
			);
1079
1080
			if ( ! current_user_can( 'edit_pages' ) ) {
1081
				$testimonials_title = $this->create_menu_item_anchor(
1082
					'ab-item ab-primary mb-icon',
1083
					Redirect::get_url( 'calypso-list-jetpack-testimonial' ),
1084
					esc_html__( 'Testimonials', 'jetpack' ),
1085
					'wp-admin-bar-edit-testimonial'
1086
				);
1087
			}
1088
1089
			$wp_admin_bar->add_menu(
1090
				array(
1091
					'parent' => 'publish',
1092
					'id'     => 'new-jetpack-testimonial',
1093
					'title'  => $testimonials_title,
1094
					'meta'   => array(
1095
						'class' => 'inline-action',
1096
					),
1097
				)
1098
			);
1099
		}
1100
1101
		// Portfolio.
1102
		if ( Jetpack::is_module_active( 'custom-content-types' ) && get_option( 'jetpack_portfolio' ) ) {
@@ 1102-1135 (lines=34) @@
1099
		}
1100
1101
		// Portfolio.
1102
		if ( Jetpack::is_module_active( 'custom-content-types' ) && get_option( 'jetpack_portfolio' ) ) {
1103
			$portfolios_title = $this->create_menu_item_pair(
1104
				array(
1105
					'url'   => Redirect::get_url( 'calypso-list-jetpack-portfolio' ),
1106
					'id'    => 'wp-admin-bar-edit-portfolio',
1107
					'label' => esc_html__( 'Portfolio', 'jetpack' ),
1108
				),
1109
				array(
1110
					'url'   => Redirect::get_url( 'calypso-edit-jetpack-portfolio' ),
1111
					'id'    => 'wp-admin-bar-new-portfolio',
1112
					'label' => esc_html_x( 'Add', 'Button label for adding a new item via the toolbar menu', 'jetpack' ),
1113
				)
1114
			);
1115
1116
			if ( ! current_user_can( 'edit_pages' ) ) {
1117
				$portfolios_title = $this->create_menu_item_anchor(
1118
					'ab-item ab-primary mb-icon',
1119
					Redirect::get_url( 'calypso-list-jetpack-portfolio' ),
1120
					esc_html__( 'Portfolio', 'jetpack' ),
1121
					'wp-admin-bar-edit-portfolio'
1122
				);
1123
			}
1124
1125
			$wp_admin_bar->add_menu(
1126
				array(
1127
					'parent' => 'publish',
1128
					'id'     => 'new-jetpack-portfolio',
1129
					'title'  => $portfolios_title,
1130
					'meta'   => array(
1131
						'class' => 'inline-action',
1132
					),
1133
				)
1134
			);
1135
		}
1136
1137
		if ( current_user_can( 'edit_theme_options' ) ) {
1138
			// Look and Feel group.