Code Duplication    Length = 13-15 lines in 3 locations

_inc/lib/admin-pages/class.jetpack-landing-page.php 1 location

@@ 130-142 (lines=13) @@
127
		return $module_name;
128
	}
129
130
	function jetpack_menu_order( $menu_order ) {
131
		$jp_menu_order = array();
132
133
		foreach ( $menu_order as $index => $item ) {
134
			if ( $item != 'jetpack' )
135
				$jp_menu_order[] = $item;
136
137
			if ( $index == 0 )
138
				$jp_menu_order[] = 'jetpack';
139
		}
140
141
		return $jp_menu_order;
142
	}
143
144
	function js_templates() {
145
		Jetpack::init()->load_view( 'admin/landing-page-templates.php' );

_inc/lib/admin-pages/class.jetpack-react-page.php 1 location

@@ 95-107 (lines=13) @@
92
			. "</script>";
93
	}
94
95
	function jetpack_menu_order( $menu_order ) {
96
		$jp_menu_order = array();
97
98
		foreach ( $menu_order as $index => $item ) {
99
			if ( $item != 'jetpack' )
100
				$jp_menu_order[] = $item;
101
102
			if ( $index == 0 )
103
				$jp_menu_order[] = 'jetpack';
104
		}
105
106
		return $jp_menu_order;
107
	}
108
109
	// Render the configuration page for the module if it exists and an error
110
	// screen if the module is not configurable

class.jetpack.php 1 location

@@ 3080-3094 (lines=15) @@
3077
		return true;
3078
	}
3079
3080
	function jetpack_menu_order( $menu_order ) {
3081
		$jp_menu_order = array();
3082
3083
		foreach ( $menu_order as $index => $item ) {
3084
			if ( $item != 'jetpack' ) {
3085
				$jp_menu_order[] = $item;
3086
			}
3087
3088
			if ( $index == 0 ) {
3089
				$jp_menu_order[] = 'jetpack';
3090
			}
3091
		}
3092
3093
		return $jp_menu_order;
3094
	}
3095
3096
	function admin_head() {
3097
		if ( isset( $_GET['configure'] ) && Jetpack::is_module( $_GET['configure'] ) && current_user_can( 'manage_options' ) )