Completed
Pull Request — trunk (#836)
by Justin
03:31
created
includes/CMB2_hookup.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
 		if ( $this->cmb->has_columns ) {
133 133
 			add_filter( 'manage_edit-comments_columns', array( $this, 'register_column_headers' ) );
134
-			add_action( 'manage_comments_custom_column', array( $this, 'column_display'  ), 10, 3 );
134
+			add_action( 'manage_comments_custom_column', array( $this, 'column_display' ), 10, 3 );
135 135
 		}
136 136
 	}
137 137
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 
149 149
 		if ( $this->cmb->has_columns ) {
150 150
 			add_filter( 'manage_users_columns', array( $this, 'register_column_headers' ) );
151
-			add_filter( 'manage_users_custom_column', array( $this, 'return_column_display'  ), 10, 3 );
151
+			add_filter( 'manage_users_custom_column', array( $this, 'return_column_display' ), 10, 3 );
152 152
 		}
153 153
 	}
154 154
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
 			if ( $this->cmb->has_columns ) {
184 184
 				add_filter( "manage_edit-{$taxonomy}_columns", array( $this, 'register_column_headers' ) );
185
-				add_filter( "manage_{$taxonomy}_custom_column", array( $this, 'return_column_display'  ), 10, 3 );
185
+				add_filter( "manage_{$taxonomy}_custom_column", array( $this, 'return_column_display' ), 10, 3 );
186 186
 			}
187 187
 		}
188 188
 
@@ -275,25 +275,25 @@  discard block
 block discarded – undo
275 275
 		$fields = $this->cmb->prop( 'fields' );
276 276
 
277 277
 		foreach ( $fields as $key => $field ) {
278
-			if ( ! isset( $field['column'] ) ) {
278
+			if ( ! isset( $field[ 'column' ] ) ) {
279 279
 				continue;
280 280
 			}
281 281
 
282
-			$column = $field['column'];
282
+			$column = $field[ 'column' ];
283 283
 
284
-			if ( false === $column['position'] ) {
284
+			if ( false === $column[ 'position' ] ) {
285 285
 
286
-				$columns[ $field['id'] ] = $column['name'];
286
+				$columns[ $field[ 'id' ] ] = $column[ 'name' ];
287 287
 
288 288
 			} else {
289 289
 
290
-				$before = array_slice( $columns, 0, absint( $column['position'] ) );
291
-				$before[ $field['id'] ] = $column['name'];
290
+				$before = array_slice( $columns, 0, absint( $column[ 'position' ] ) );
291
+				$before[ $field[ 'id' ] ] = $column[ 'name' ];
292 292
 				$columns = $before + $columns;
293 293
 			}
294 294
 
295
-			$column['field'] = $field;
296
-			$this->columns[ $field['id'] ] = $column;
295
+			$column[ 'field' ] = $field;
296
+			$this->columns[ $field[ 'id' ] ] = $column;
297 297
 		}
298 298
 
299 299
 		return $columns;
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 	public function column_display( $column_name, $object_id ) {
307 307
 		if ( isset( $this->columns[ $column_name ] ) ) {
308 308
  			$field = new CMB2_Field( array(
309
-				'field_args'  => $this->columns[ $column_name ]['field'],
309
+				'field_args'  => $this->columns[ $column_name ][ 'field' ],
310 310
 				'object_type' => $this->object_type,
311 311
 				'object_id'   => $this->cmb->object_id( $object_id ),
312 312
 				'cmb_id'      => $this->cmb->cmb_id,
@@ -360,13 +360,13 @@  discard block
 block discarded – undo
360 360
 		}
361 361
 
362 362
 		// Include a generic context wrapper and the postbox wrapper.
363
-		$classes[] = 'postbox cmb2-context-wrap';
363
+		$classes[ ] = 'postbox cmb2-context-wrap';
364 364
 
365 365
 		// Include a context-type based context wrapper.
366
-		$classes[] = 'cmb2-context-wrap-' . $cmb->prop( 'context' );
366
+		$classes[ ] = 'cmb2-context-wrap-' . $cmb->prop( 'context' );
367 367
 
368 368
 		// Include an ID based context wrapper as well.
369
-		$classes[] = 'cmb2-context-wrap-' . $cmb->prop( 'id' );
369
+		$classes[ ] = 'cmb2-context-wrap-' . $cmb->prop( 'id' );
370 370
 
371 371
 		// Return the updated array of classes.
372 372
 		return $classes;
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 	 * @return array           Modified array of classes
432 432
 	 */
433 433
 	public function close_metabox_class( $classes ) {
434
-		$classes[] = 'closed';
434
+		$classes[ ] = 'closed';
435 435
 		return $classes;
436 436
 	}
437 437
 
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
 	public function user_new_metabox( $section ) {
452 452
 		if ( $section == $this->cmb->prop( 'new_user_section' ) ) {
453 453
 			$object_id = $this->cmb->object_id();
454
-			$this->cmb->object_id( isset( $_REQUEST['user_id'] ) ? $_REQUEST['user_id'] : $object_id );
454
+			$this->cmb->object_id( isset( $_REQUEST[ 'user_id' ] ) ? $_REQUEST[ 'user_id' ] : $object_id );
455 455
 			$this->user_metabox();
456 456
 		}
457 457
 	}
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
 
633 633
 			$data_to_delete = array();
634 634
 			foreach ( $this->cmb->prop( 'fields' ) as $field ) {
635
-				$data_to_delete[ $field['id'] ] = '';
635
+				$data_to_delete[ $field[ 'id' ] ] = '';
636 636
 			}
637 637
 
638 638
 			$this->cmb->save_fields( $term_id, 'term', $data_to_delete );
Please login to merge, or discard this patch.