Code Duplication    Length = 32-32 lines in 2 locations

modules/masterbar/masterbar.php 2 locations

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