Code Duplication    Length = 32-32 lines in 2 locations

modules/masterbar/masterbar.php 2 locations

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