Code Duplication    Length = 34-34 lines in 2 locations

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

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