Code Duplication    Length = 32-32 lines in 2 locations

modules/masterbar/masterbar.php 2 locations

@@ 740-771 (lines=32) @@
737
		}
738
739
		// Testimonials
740
		if ( Jetpack::is_module_active( 'custom-content-types' ) && get_option( 'jetpack_testimonial' ) ) {
741
			$testimonials_title = $this->create_menu_item_pair(
742
				array(
743
					'url'   => 'https://wordpress.com/types/jetpack-testimonial/' . esc_attr( $this->primary_site_slug ),
744
					'id'    => 'wp-admin-bar-edit-testimonial',
745
					'label' => esc_html__( 'Testimonials', 'jetpack' ),
746
				),
747
				array(
748
					'url'   => 'https://wordpress.com/edit/jetpack-testimonial/' . esc_attr( $this->primary_site_slug ),
749
					'id'    => 'wp-admin-bar-new-testimonial',
750
					'label' => esc_html_x( 'Add', 'Button label for adding a new item via the toolbar menu', 'jetpack' ),
751
				)
752
			);
753
754
			if ( ! current_user_can( 'edit_pages' ) ) {
755
				$testimonials_title = $this->create_menu_item_anchor(
756
					'ab-item ab-primary mb-icon',
757
					'https://wordpress.com/types/jetpack-testimonial/' . esc_attr( $this->primary_site_slug ),
758
					esc_html__( 'Testimonials', 'jetpack' ),
759
					'wp-admin-bar-edit-testimonial'
760
				);
761
			}
762
763
			$wp_admin_bar->add_menu( array(
764
				'parent' => 'publish',
765
				'id'     => 'new-jetpack-testimonial',
766
				'title'  => $testimonials_title,
767
				'meta'   => array(
768
					'class' => 'inline-action',
769
				),
770
			) );
771
		}
772
773
		// Portfolio
774
		if ( Jetpack::is_module_active( 'custom-content-types' ) && get_option( 'jetpack_portfolio' ) ) {
@@ 774-805 (lines=32) @@
771
		}
772
773
		// Portfolio
774
		if ( Jetpack::is_module_active( 'custom-content-types' ) && get_option( 'jetpack_portfolio' ) ) {
775
			$portfolios_title = $this->create_menu_item_pair(
776
				array(
777
					'url'   => 'https://wordpress.com/types/jetpack-portfolio/' . esc_attr( $this->primary_site_slug ),
778
					'id'    => 'wp-admin-bar-edit-portfolio',
779
					'label' => esc_html__( 'Portfolio', 'jetpack' ),
780
				),
781
				array(
782
					'url'   => 'https://wordpress.com/edit/jetpack-portfolio/' . esc_attr( $this->primary_site_slug ),
783
					'id'    => 'wp-admin-bar-new-portfolio',
784
					'label' => esc_html_x( 'Add', 'Button label for adding a new item via the toolbar menu', 'jetpack' ),
785
				)
786
			);
787
788
			if ( ! current_user_can( 'edit_pages' ) ) {
789
				$portfolios_title = $this->create_menu_item_anchor(
790
					'ab-item ab-primary mb-icon',
791
					'https://wordpress.com/types/jetpack-portfolio/' . esc_attr( $this->primary_site_slug ),
792
					esc_html__( 'Portfolio', 'jetpack' ),
793
					'wp-admin-bar-edit-portfolio'
794
				);
795
			}
796
797
			$wp_admin_bar->add_menu( array(
798
				'parent' => 'publish',
799
				'id'     => 'new-jetpack-portfolio',
800
				'title'  => $portfolios_title,
801
				'meta'   => array(
802
					'class' => 'inline-action',
803
				),
804
			) );
805
		}
806
807
		if ( current_user_can( 'edit_theme_options' ) ) {
808
			// Look and Feel group