Code Duplication    Length = 32-32 lines in 2 locations

modules/masterbar/masterbar.php 2 locations

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