Code Duplication    Length = 34-34 lines in 2 locations

modules/masterbar/masterbar.php 2 locations

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