Code Duplication    Length = 32-32 lines in 2 locations

modules/masterbar/masterbar.php 2 locations

@@ 671-702 (lines=32) @@
668
		) );
669
670
		// Testimonials
671
		if ( Jetpack::is_module_active( 'custom-content-types' ) && get_option( 'jetpack_testimonial' ) ) {
672
			$testimonials_title = $this->create_menu_item_pair(
673
				array(
674
					'url'   => 'https://wordpress.com/types/jetpack-testimonial/' . esc_attr( $this->primary_site_slug ),
675
					'id'    => 'wp-admin-bar-edit-testimonial',
676
					'label' => __( 'Testimonials', 'jetpack' ),
677
				),
678
				array(
679
					'url'   => 'https://wordpress.com/edit/jetpack-testimonial/' . esc_attr( $this->primary_site_slug ),
680
					'id'    => 'wp-admin-bar-new-testimonial',
681
					'label' => _x( 'Add', 'admin bar menu new item label', 'jetpack' ),
682
				)
683
			);
684
685
			if ( ! current_user_can( 'edit_pages' ) ) {
686
				$testimonials_title = $this->create_menu_item_anchor(
687
					'ab-item ab-primary mb-icon',
688
					'https://wordpress.com/types/jetpack-testimonial/' . esc_attr( $this->primary_site_slug ),
689
					__( 'Testimonials', 'jetpack' ),
690
					'wp-admin-bar-edit-testimonial'
691
				);
692
			}
693
694
			$wp_admin_bar->add_menu( array(
695
				'parent' => 'publish',
696
				'id'     => 'new-jetpack-testimonial',
697
				'title'  => $testimonials_title,
698
				'meta'   => array(
699
					'class' => 'inline-action',
700
				),
701
			) );
702
		}
703
704
		// Portfolio
705
		if ( Jetpack::is_module_active( 'custom-content-types' ) && get_option( 'jetpack_portfolio' ) ) {
@@ 705-736 (lines=32) @@
702
		}
703
704
		// Portfolio
705
		if ( Jetpack::is_module_active( 'custom-content-types' ) && get_option( 'jetpack_portfolio' ) ) {
706
			$portfolios_title = $this->create_menu_item_pair(
707
				array(
708
					'url'   => 'https://wordpress.com/types/jetpack-portfolio/' . esc_attr( $this->primary_site_slug ),
709
					'id'    => 'wp-admin-bar-edit-portfolio',
710
					'label' => __( 'Portfolio', 'jetpack' ),
711
				),
712
				array(
713
					'url'   => 'https://wordpress.com/edit/jetpack-portfolio/' . esc_attr( $this->primary_site_slug ),
714
					'id'    => 'wp-admin-bar-new-portfolio',
715
					'label' => _x( 'Add', 'admin bar menu new item label', 'jetpack' ),
716
				)
717
			);
718
719
			if ( ! current_user_can( 'edit_pages' ) ) {
720
				$portfolios_title = $this->create_menu_item_anchor(
721
					'ab-item ab-primary mb-icon',
722
					'https://wordpress.com/types/jetpack-portfolio/' . esc_attr( $this->primary_site_slug ),
723
					__( 'Portfolio', 'jetpack' ),
724
					'wp-admin-bar-edit-portfolio'
725
				);
726
			}
727
728
			$wp_admin_bar->add_menu( array(
729
				'parent' => 'publish',
730
				'id'     => 'new-jetpack-portfolio',
731
				'title'  => $portfolios_title,
732
				'meta'   => array(
733
					'class' => 'inline-action',
734
				),
735
			) );
736
		}
737
738
		if ( current_user_can( 'edit_theme_options' ) ) {
739
			// Look and Feel group