Code Duplication    Length = 32-32 lines in 2 locations

modules/masterbar/masterbar.php 2 locations

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