Completed
Push — master ( 157cf9...0e73b5 )
by Sam
03:38
created
src/Menus.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
 		// Home page (also change the first submenu item's title).
92 92
 		add_menu_page( 'Tabulate', 'Tabulate', 'read', TABULATE_SLUG, $dispatch_callback );
93
-		$page_title = ( isset( $_GET['table'] ) ) ? Text::titlecase( $_GET['table'] ) : 'Tabulate';
93
+		$page_title = ( isset( $_GET[ 'table' ] ) ) ? Text::titlecase( $_GET[ 'table' ] ) : 'Tabulate';
94 94
 		add_submenu_page( TABULATE_SLUG, $page_title, 'Overview', 'read', TABULATE_SLUG, $dispatch_callback );
95 95
 
96 96
 		// Add submenu pages.
@@ -147,17 +147,17 @@  discard block
 block discarded – undo
147 147
 
148 148
 		// Only dispatch when it's our page.
149 149
 		$slug_lenth = strlen( TABULATE_SLUG );
150
-		if ( ! isset( $request['page'] ) || substr( $request['page'], 0, $slug_lenth ) !== TABULATE_SLUG ) {
150
+		if ( ! isset( $request[ 'page' ] ) || substr( $request[ 'page' ], 0, $slug_lenth ) !== TABULATE_SLUG ) {
151 151
 			return;
152 152
 		}
153 153
 
154 154
 		// Discern the controller name, based on an explicit request parameter, or
155 155
 		// the trailing part of the page slug (i.e. after 'tabulate_').
156 156
 		$controller_name = 'home';
157
-		if ( isset( $request['controller'] ) && strlen( $request['controller'] ) > 0 ) {
158
-			$controller_name = $request['controller'];
159
-		} elseif ( isset( $request['page'] ) && strlen( $request['page'] ) > $slug_lenth ) {
160
-			$controller_name = substr( $request['page'], $slug_lenth + 1 );
157
+		if ( isset( $request[ 'controller' ] ) && strlen( $request[ 'controller' ] ) > 0 ) {
158
+			$controller_name = $request[ 'controller' ];
159
+		} elseif ( isset( $request[ 'page' ] ) && strlen( $request[ 'page' ] ) > $slug_lenth ) {
160
+			$controller_name = substr( $request[ 'page' ], $slug_lenth + 1 );
161 161
 		}
162 162
 
163 163
 		// Create the controller and run the action.
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 		}
168 168
 		$controller = new $controller_classname( $this->wpdb );
169 169
 		$controller->set_filesystem( $this->filesystem );
170
-		$action = ! empty( $request['action'] ) ? $request['action'] : 'index';
171
-		unset( $request['page'], $request['controller'], $request['action'] );
170
+		$action = ! empty( $request[ 'action' ] ) ? $request[ 'action' ] : 'index';
171
+		unset( $request[ 'page' ], $request[ 'controller' ], $request[ 'action' ] );
172 172
 		try {
173 173
 			$this->output = $controller->$action( $request );
174 174
 		} catch ( Exception $e ) {
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 		$script_url = plugins_url( TABULATE_SLUG ) . '/assets/scripts.js';
216 216
 		$deps = array( 'jquery-ui-autocomplete', 'tabulate-omnivore', 'tabulate-maskedinput', 'tabulate-timepicker' );
217 217
 		if ( Util::is_plugin_active( 'rest-api/plugin.php' ) ) {
218
-			$deps[] = 'wp-api';
218
+			$deps[ ] = 'wp-api';
219 219
 		}
220 220
 		wp_enqueue_script( 'tabulate-scripts', $script_url, $deps, TABULATE_VERSION, true );
221 221
 
Please login to merge, or discard this patch.