Code Duplication    Length = 34-34 lines in 2 locations

modules/masterbar/masterbar/masterbar.php 2 locations

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