Code Duplication    Length = 10-11 lines in 2 locations

projects/plugins/jetpack/modules/masterbar/admin-menu/class-atomic-admin-menu.php 2 locations

@@ 347-357 (lines=11) @@
344
	 * @param bool $wp_admin_themes Optional. Whether Themes link should point to Calypso or wp-admin. Default false (Calypso).
345
	 * @param bool $wp_admin_customize Optional. Whether Customize link should point to Calypso or wp-admin. Default false (Calypso).
346
	 */
347
	public function add_appearance_menu( $wp_admin_themes = false, $wp_admin_customize = false ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
348
		// Customize on Atomic sites is always done on WP Admin.
349
		parent::add_appearance_menu( $wp_admin_themes, true );
350
351
		// Do not add links to WP Admin when Calypso is forced.
352
		if ( $this->should_force_calypso_links() ) {
353
			return;
354
		}
355
356
		add_submenu_page( 'themes.php', esc_attr__( 'Add New Theme', 'jetpack' ), __( 'Add New Theme', 'jetpack' ), 'install_themes', 'theme-install.php', null, 1 );
357
	}
358
359
	/**
360
	 * Override the global submenu_file for theme-install.php page so the WP Admin menu item gets highlighted correctly.
@@ 379-388 (lines=10) @@
376
	 *
377
	 * @param bool $wp_admin Optional. Whether links should point to Calypso or wp-admin. Default false (Calypso).
378
	 */
379
	public function add_users_menu( $wp_admin = false ) {
380
		parent::add_users_menu( $wp_admin );
381
382
		// Do not add links to WP Admin when Calypso is forced.
383
		if ( $this->should_force_calypso_links() ) {
384
			return;
385
		}
386
387
		add_submenu_page( 'users.php', esc_attr__( 'Advanced Users Management', 'jetpack' ), __( 'Advanced Users Management', 'jetpack' ), 'list_users', 'users.php', null, 2 );
388
	}
389
390
	/**
391
	 * Also remove the Gutenberg plugin menu.