Code Duplication    Length = 6-7 lines in 2 locations

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

@@ 428-434 (lines=7) @@
425
			add_submenu_page( $themes_slug, esc_attr__( 'Background', 'jetpack' ), __( 'Background', 'jetpack' ), 'customize', esc_url( $customize_background_url ), null, 20 );
426
		}
427
428
		if ( current_theme_supports( 'widgets' ) ) {
429
			remove_submenu_page( 'themes.php', 'widgets.php' );
430
			remove_submenu_page( 'themes.php', 'gutenberg-widgets' );
431
432
			$customize_widgets_url = $wp_admin_customize ? 'widgets.php' : add_query_arg( array( 'autofocus' => array( 'panel' => 'widgets' ) ), $customize_slug );
433
			add_submenu_page( $themes_slug, esc_attr__( 'Widgets', 'jetpack' ), __( 'Widgets', 'jetpack' ), 'customize', esc_url( $customize_widgets_url ), null, 20 );
434
		}
435
436
		if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {
437
			remove_submenu_page( 'themes.php', 'nav-menus.php' );
@@ 436-441 (lines=6) @@
433
			add_submenu_page( $themes_slug, esc_attr__( 'Widgets', 'jetpack' ), __( 'Widgets', 'jetpack' ), 'customize', esc_url( $customize_widgets_url ), null, 20 );
434
		}
435
436
		if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {
437
			remove_submenu_page( 'themes.php', 'nav-menus.php' );
438
439
			$customize_menus_url = $wp_admin_customize ? 'nav-menus.php' : add_query_arg( array( 'autofocus' => array( 'panel' => 'nav_menus' ) ), $customize_slug );
440
			add_submenu_page( $themes_slug, esc_attr__( 'Menus', 'jetpack' ), __( 'Menus', 'jetpack' ), 'customize', esc_url( $customize_menus_url ), null, 20 );
441
		}
442
443
		// Register menu for the Custom CSS Jetpack module, but don't add it as a menu item.
444
		$GLOBALS['_registered_pages']['admin_page_editcss'] = true; // phpcs:ignore