Code Duplication    Length = 34-34 lines in 2 locations

modules/masterbar/masterbar.php 2 locations

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