Code Duplication    Length = 32-32 lines in 2 locations

modules/masterbar/masterbar.php 2 locations

@@ 780-811 (lines=32) @@
777
		}
778
779
		// Testimonials
780
		if ( Jetpack::is_module_active( 'custom-content-types' ) && get_option( 'jetpack_testimonial' ) ) {
781
			$testimonials_title = $this->create_menu_item_pair(
782
				array(
783
					'url'   => 'https://wordpress.com/types/jetpack-testimonial/' . esc_attr( $this->primary_site_slug ),
784
					'id'    => 'wp-admin-bar-edit-testimonial',
785
					'label' => esc_html__( 'Testimonials', 'jetpack' ),
786
				),
787
				array(
788
					'url'   => 'https://wordpress.com/edit/jetpack-testimonial/' . esc_attr( $this->primary_site_slug ),
789
					'id'    => 'wp-admin-bar-new-testimonial',
790
					'label' => esc_html_x( 'Add', 'Button label for adding a new item via the toolbar menu', 'jetpack' ),
791
				)
792
			);
793
794
			if ( ! current_user_can( 'edit_pages' ) ) {
795
				$testimonials_title = $this->create_menu_item_anchor(
796
					'ab-item ab-primary mb-icon',
797
					'https://wordpress.com/types/jetpack-testimonial/' . esc_attr( $this->primary_site_slug ),
798
					esc_html__( 'Testimonials', 'jetpack' ),
799
					'wp-admin-bar-edit-testimonial'
800
				);
801
			}
802
803
			$wp_admin_bar->add_menu( array(
804
				'parent' => 'publish',
805
				'id'     => 'new-jetpack-testimonial',
806
				'title'  => $testimonials_title,
807
				'meta'   => array(
808
					'class' => 'inline-action',
809
				),
810
			) );
811
		}
812
813
		// Portfolio
814
		if ( Jetpack::is_module_active( 'custom-content-types' ) && get_option( 'jetpack_portfolio' ) ) {
@@ 814-845 (lines=32) @@
811
		}
812
813
		// Portfolio
814
		if ( Jetpack::is_module_active( 'custom-content-types' ) && get_option( 'jetpack_portfolio' ) ) {
815
			$portfolios_title = $this->create_menu_item_pair(
816
				array(
817
					'url'   => 'https://wordpress.com/types/jetpack-portfolio/' . esc_attr( $this->primary_site_slug ),
818
					'id'    => 'wp-admin-bar-edit-portfolio',
819
					'label' => esc_html__( 'Portfolio', 'jetpack' ),
820
				),
821
				array(
822
					'url'   => 'https://wordpress.com/edit/jetpack-portfolio/' . esc_attr( $this->primary_site_slug ),
823
					'id'    => 'wp-admin-bar-new-portfolio',
824
					'label' => esc_html_x( 'Add', 'Button label for adding a new item via the toolbar menu', 'jetpack' ),
825
				)
826
			);
827
828
			if ( ! current_user_can( 'edit_pages' ) ) {
829
				$portfolios_title = $this->create_menu_item_anchor(
830
					'ab-item ab-primary mb-icon',
831
					'https://wordpress.com/types/jetpack-portfolio/' . esc_attr( $this->primary_site_slug ),
832
					esc_html__( 'Portfolio', 'jetpack' ),
833
					'wp-admin-bar-edit-portfolio'
834
				);
835
			}
836
837
			$wp_admin_bar->add_menu( array(
838
				'parent' => 'publish',
839
				'id'     => 'new-jetpack-portfolio',
840
				'title'  => $portfolios_title,
841
				'meta'   => array(
842
					'class' => 'inline-action',
843
				),
844
			) );
845
		}
846
847
		if ( current_user_can( 'edit_theme_options' ) ) {
848
			// Look and Feel group