Code Duplication    Length = 34-34 lines in 2 locations

modules/masterbar/masterbar/class-masterbar.php 2 locations

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