Code Duplication    Length = 34-34 lines in 2 locations

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

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