Code Duplication    Length = 18-23 lines in 2 locations

projects/plugins/jetpack/modules/masterbar/admin-menu/class-atomic-admin-menu.php 1 location

@@ 75-97 (lines=23) @@
72
	/**
73
	 * Create the desired menu output.
74
	 */
75
	public function reregister_menu_items() {
76
		parent::reregister_menu_items();
77
78
		$this->add_my_home_menu();
79
80
		// Not needed outside of wp-admin.
81
		if ( ! $this->is_api_request ) {
82
			$this->add_browse_sites_link();
83
			$this->add_site_card_menu();
84
			$nudge = $this->get_upsell_nudge();
85
			if ( $nudge ) {
86
				parent::add_upsell_nudge( $nudge );
87
			}
88
			$this->add_new_site_link();
89
		}
90
91
		// Add WP Admin menu when Calypso is enforced.
92
		if ( $this->should_force_calypso_links() ) {
93
			$this->add_wp_admin_menu();
94
		}
95
96
		ksort( $GLOBALS['menu'] );
97
	}
98
99
	/**
100
	 * Whether to use wp-admin pages rather than Calypso.

projects/plugins/jetpack/modules/masterbar/admin-menu/class-wpcom-admin-menu.php 1 location

@@ 51-68 (lines=18) @@
48
	/**
49
	 * Create the desired menu output.
50
	 */
51
	public function reregister_menu_items() {
52
		parent::reregister_menu_items();
53
54
		$this->add_my_home_menu();
55
56
		// Not needed outside of wp-admin.
57
		if ( ! $this->is_api_request ) {
58
			$this->add_browse_sites_link();
59
			$this->add_site_card_menu();
60
			$nudge = $this->get_upsell_nudge();
61
			if ( $nudge ) {
62
				parent::add_upsell_nudge( $nudge );
63
			}
64
			$this->add_new_site_link();
65
		}
66
67
		ksort( $GLOBALS['menu'] );
68
	}
69
70
	/**
71
	 * Adds the site switcher link if user has more than one site.