Code Duplication    Length = 32-32 lines in 2 locations

modules/masterbar/masterbar.php 2 locations

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