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' );

class.jetpack.php 1 location

@@ 3100-3114 (lines=15) @@
3097
		return true;
3098
	}
3099
3100
	function jetpack_menu_order( $menu_order ) {
3101
		$jp_menu_order = array();
3102
3103
		foreach ( $menu_order as $index => $item ) {
3104
			if ( $item != 'jetpack' ) {
3105
				$jp_menu_order[] = $item;
3106
			}
3107
3108
			if ( $index == 0 ) {
3109
				$jp_menu_order[] = 'jetpack';
3110
			}
3111
		}
3112
3113
		return $jp_menu_order;
3114
	}
3115
3116
	function admin_head() {
3117
		if ( isset( $_GET['configure'] ) && Jetpack::is_module( $_GET['configure'] ) && current_user_can( 'manage_options' ) )

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

@@ 82-94 (lines=13) @@
79
		echo '</noscript>';
80
	}
81
82
	function jetpack_menu_order( $menu_order ) {
83
		$jp_menu_order = array();
84
85
		foreach ( $menu_order as $index => $item ) {
86
			if ( $item != 'jetpack' )
87
				$jp_menu_order[] = $item;
88
89
			if ( $index == 0 )
90
				$jp_menu_order[] = 'jetpack';
91
		}
92
93
		return $jp_menu_order;
94
	}
95
96
	// Render the configuration page for the module if it exists and an error
97
	// screen if the module is not configurable