Code Duplication    Length = 32-32 lines in 2 locations

modules/masterbar/masterbar.php 2 locations

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