Completed
Pull Request — trunk (#582)
by Juliette
05:30
created
includes/helper-functions.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 		$cmb = CMB2_Boxes::get( $meta_box );
179 179
 	} else {
180 180
 		// See if we already have an instance of this metabox
181
-		$cmb = CMB2_Boxes::get( $meta_box['id'] );
181
+		$cmb = CMB2_Boxes::get( $meta_box[ 'id' ] );
182 182
 		// If not, we'll initate a new metabox
183 183
 		$cmb = $cmb ? $cmb : new CMB2( $meta_box, $object_id );
184 184
 	}
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 	) );
255 255
 
256 256
 	// Set object type explicitly (rather than trying to guess from context)
257
-	$cmb->object_type( $args['object_type'] );
257
+	$cmb->object_type( $args[ 'object_type' ] );
258 258
 
259 259
 	// Save the metabox if it's been submitted
260 260
 	// check permissions
@@ -262,32 +262,32 @@  discard block
 block discarded – undo
262 262
 	if (
263 263
 		$cmb->prop( 'save_fields' )
264 264
 		// check nonce
265
-		&& isset( $_POST['submit-cmb'], $_POST['object_id'], $_POST[ $cmb->nonce() ] )
265
+		&& isset( $_POST[ 'submit-cmb' ], $_POST[ 'object_id' ], $_POST[ $cmb->nonce() ] )
266 266
 		&& wp_verify_nonce( $_POST[ $cmb->nonce() ], $cmb->nonce() )
267
-		&& $object_id && $_POST['object_id'] == $object_id
267
+		&& $object_id && $_POST[ 'object_id' ] == $object_id
268 268
 	) {
269 269
 		$cmb->save_fields( $object_id, $cmb->object_type(), $_POST );
270 270
 	}
271 271
 
272 272
 	// Enqueue JS/CSS
273
-	if ( $args['cmb_styles'] ) {
273
+	if ( $args[ 'cmb_styles' ] ) {
274 274
 		CMB2_hookup::enqueue_cmb_css();
275 275
 	}
276 276
 
277
-	if ( $args['enqueue_js'] ) {
277
+	if ( $args[ 'enqueue_js' ] ) {
278 278
 		CMB2_hookup::enqueue_cmb_js();
279 279
 	}
280 280
 
281
-	$form_format = apply_filters( 'cmb2_get_metabox_form_format', $args['form_format'], $object_id, $cmb );
281
+	$form_format = apply_filters( 'cmb2_get_metabox_form_format', $args[ 'form_format' ], $object_id, $cmb );
282 282
 
283 283
 	$format_parts = explode( '%3$s', $form_format );
284 284
 
285 285
 	// Show cmb form
286
-	printf( $format_parts[0], $cmb->cmb_id, $object_id );
286
+	printf( $format_parts[ 0 ], $cmb->cmb_id, $object_id );
287 287
 	$cmb->show_form();
288 288
 
289
-	if ( isset( $format_parts[1] ) && $format_parts[1] ) {
290
-		printf( str_ireplace( '%4$s', '%1$s', $format_parts[1] ), $args['save_button'] );
289
+	if ( isset( $format_parts[ 1 ] ) && $format_parts[ 1 ] ) {
290
+		printf( str_ireplace( '%4$s', '%1$s', $format_parts[ 1 ] ), $args[ 'save_button' ] );
291 291
 	}
292 292
 
293 293
 }
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
  * @param  array   $args      Optional arguments array
301 301
  */
302 302
 function cmb2_metabox_form( $meta_box, $object_id = 0, $args = array() ) {
303
-	if ( ! isset( $args['echo'] ) || $args['echo'] ) {
303
+	if ( ! isset( $args[ 'echo' ] ) || $args[ 'echo' ] ) {
304 304
 		cmb2_print_metabox_form( $meta_box, $object_id, $args );
305 305
 	} else {
306 306
 		return cmb2_get_metabox_form( $meta_box, $object_id, $args );
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 
323 323
 		$schedule_format = str_replace(
324 324
 			array( 'M', 'Y', 'm', 'd', 'H', 'i', 'a' ),
325
-			array('%b', '%Y', '%m', '%d', '%H', '%M', '%p' ),
325
+			array( '%b', '%Y', '%m', '%d', '%H', '%M', '%p' ),
326 326
 			$date_format
327 327
 		);
328 328
 
@@ -339,14 +339,14 @@  discard block
 block discarded – undo
339 339
 			 * 4 or 2 characters, as needed
340 340
 			 */
341 341
 			'%04d-%02d-%02d %02d:%02d:%02d',
342
-			$parsed_time['tm_year'] + 1900,  // This will be "111", so we need to add 1900.
343
-			$parsed_time['tm_mon'] + 1,      // This will be the month minus one, so we add one.
344
-			$parsed_time['tm_mday'],
345
-			$parsed_time['tm_hour'],
346
-			$parsed_time['tm_min'],
347
-			$parsed_time['tm_sec']
342
+			$parsed_time[ 'tm_year' ] + 1900, // This will be "111", so we need to add 1900.
343
+			$parsed_time[ 'tm_mon' ] + 1, // This will be the month minus one, so we add one.
344
+			$parsed_time[ 'tm_mday' ],
345
+			$parsed_time[ 'tm_hour' ],
346
+			$parsed_time[ 'tm_min' ],
347
+			$parsed_time[ 'tm_sec' ]
348 348
 		);
349 349
 
350
-		return new DateTime($ymd);
350
+		return new DateTime( $ymd );
351 351
 	}
352 352
 }
Please login to merge, or discard this patch.
includes/CMB2.php 1 patch
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -118,19 +118,19 @@  discard block
 block discarded – undo
118 118
 	 */
119 119
 	public function __construct( $meta_box, $object_id = 0 ) {
120 120
 
121
-		if ( empty( $meta_box['id'] ) ) {
121
+		if ( empty( $meta_box[ 'id' ] ) ) {
122 122
 			wp_die( __( 'Metabox configuration is required to have an ID parameter', 'cmb2' ) );
123 123
 		}
124 124
 
125 125
 		$this->meta_box = wp_parse_args( $meta_box, $this->mb_defaults );
126
-		$this->meta_box['fields'] = array();
126
+		$this->meta_box[ 'fields' ] = array();
127 127
 
128 128
 		$this->object_id( $object_id );
129 129
 		$this->mb_object_type();
130
-		$this->cmb_id = $meta_box['id'];
130
+		$this->cmb_id = $meta_box[ 'id' ];
131 131
 
132
-		if ( ! empty( $meta_box['fields'] ) && is_array( $meta_box['fields'] ) ) {
133
-			$this->add_fields( $meta_box['fields'] );
132
+		if ( ! empty( $meta_box[ 'fields' ] ) && is_array( $meta_box[ 'fields' ] ) ) {
133
+			$this->add_fields( $meta_box[ 'fields' ] );
134 134
 		}
135 135
 
136 136
 		CMB2_Boxes::add( $this );
@@ -261,16 +261,16 @@  discard block
 block discarded – undo
261 261
 	 * @return mixed CMB2_Field object if successful.
262 262
 	 */
263 263
 	public function render_field( $field_args ) {
264
-		$field_args['context'] = $this->prop( 'context' );
264
+		$field_args[ 'context' ] = $this->prop( 'context' );
265 265
 
266
-		if ( 'group' == $field_args['type'] ) {
266
+		if ( 'group' == $field_args[ 'type' ] ) {
267 267
 
268
-			if ( ! isset( $field_args['show_names'] ) ) {
269
-				$field_args['show_names'] = $this->prop( 'show_names' );
268
+			if ( ! isset( $field_args[ 'show_names' ] ) ) {
269
+				$field_args[ 'show_names' ] = $this->prop( 'show_names' );
270 270
 			}
271 271
 			$field = $this->render_group( $field_args );
272 272
 
273
-		} elseif ( 'hidden' == $field_args['type'] && $this->get_field( $field_args )->should_show() ) {
273
+		} elseif ( 'hidden' == $field_args[ 'type' ] && $this->get_field( $field_args )->should_show() ) {
274 274
 			// Save rendering for after the metabox
275 275
 			$field = $this->add_hidden_field( array(
276 276
 				'field_args'  => $field_args,
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 
281 281
 		} else {
282 282
 
283
-			$field_args['show_names'] = $this->prop( 'show_names' );
283
+			$field_args[ 'show_names' ] = $this->prop( 'show_names' );
284 284
 
285 285
 			// Render default fields
286 286
 			$field = $this->get_field( $field_args )->render_field();
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
 	 */
297 297
 	public function render_group( $args ) {
298 298
 
299
-		if ( ! isset( $args['id'], $args['fields'] ) || ! is_array( $args['fields'] ) ) {
299
+		if ( ! isset( $args[ 'id' ], $args[ 'fields' ] ) || ! is_array( $args[ 'fields' ] ) ) {
300 300
 			return;
301 301
 		}
302 302
 
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 		 *
330 330
 		 * @param string $id The group_id of the current group.
331 331
 		 */
332
-		$more_attributes = apply_filters( "cmb2_additional_group_attributes", '', $field_group->args, $args['id'] );
332
+		$more_attributes = apply_filters( "cmb2_additional_group_attributes", '', $field_group->args, $args[ 'id' ] );
333 333
 
334 334
 		$field_group->peform_param_callback( 'before_group' );
335 335
 
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 			<div class="inside cmb-td cmb-nested cmb-field-list">';
394 394
 				// Loop and render repeatable group fields
395 395
 				foreach ( array_values( $field_group->args( 'fields' ) ) as $field_args ) {
396
-					if ( 'hidden' == $field_args['type'] ) {
396
+					if ( 'hidden' == $field_args[ 'type' ] ) {
397 397
 
398 398
 						// Save rendering for after the metabox
399 399
 						$this->add_hidden_field( array(
@@ -403,8 +403,8 @@  discard block
 block discarded – undo
403 403
 
404 404
 					} else {
405 405
 
406
-						$field_args['show_names'] = $field_group->args( 'show_names' );
407
-						$field_args['context']    = $field_group->args( 'context' );
406
+						$field_args[ 'show_names' ] = $field_group->args( 'show_names' );
407
+						$field_args[ 'context' ]    = $field_group->args( 'context' );
408 408
 
409 409
 						$field = $this->get_field( $field_args, $field_group )->render_field();
410 410
 					}
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 	 */
434 434
 	public function add_hidden_field( $args ) {
435 435
 		$field = new CMB2_Field( $args );
436
-		$this->hidden_fields[] = new CMB2_Types( $field );
436
+		$this->hidden_fields[ ] = new CMB2_Types( $field );
437 437
 
438 438
 		return $field;
439 439
 	}
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
 	 */
573 573
 	public function process_field( $field_args ) {
574 574
 
575
-		switch ( $field_args['type'] ) {
575
+		switch ( $field_args[ 'type' ] ) {
576 576
 
577 577
 			case 'group':
578 578
 				$this->save_group( $field_args );
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 				) );
593 593
 
594 594
 				if ( $field->save_field_from_data( $this->data_to_save ) ) {
595
-					$this->updated[] = $field->id();
595
+					$this->updated[ ] = $field->id();
596 596
 				}
597 597
 
598 598
 				break;
@@ -605,11 +605,11 @@  discard block
 block discarded – undo
605 605
 	 */
606 606
 	public function save_group( $args ) {
607 607
 
608
-		if ( ! isset( $args['id'], $args['fields'], $this->data_to_save[ $args['id'] ] ) || ! is_array( $args['fields'] ) ) {
608
+		if ( ! isset( $args[ 'id' ], $args[ 'fields' ], $this->data_to_save[ $args[ 'id' ] ] ) || ! is_array( $args[ 'fields' ] ) ) {
609 609
 			return;
610 610
 		}
611 611
 
612
-		$field_group        = new CMB2_Field( array(
612
+		$field_group = new CMB2_Field( array(
613 613
 			'field_args'  => $args,
614 614
 			'object_type' => $this->object_type(),
615 615
 			'object_id'   => $this->object_id(),
@@ -644,16 +644,16 @@  discard block
 block discarded – undo
644 644
 						$_new_val = array();
645 645
 						foreach ( $new_val as $group_index => $grouped_data ) {
646 646
 							// Add the supporting data to the $saved array stack
647
-							$saved[ $field_group->index ][ $grouped_data['supporting_field_id'] ][] = $grouped_data['supporting_field_value'];
647
+							$saved[ $field_group->index ][ $grouped_data[ 'supporting_field_id' ] ][ ] = $grouped_data[ 'supporting_field_value' ];
648 648
 							// Reset var to the actual value
649
-							$_new_val[ $group_index ] = $grouped_data['value'];
649
+							$_new_val[ $group_index ] = $grouped_data[ 'value' ];
650 650
 						}
651 651
 						$new_val = $_new_val;
652 652
 					} else {
653 653
 						// Add the supporting data to the $saved array stack
654
-						$saved[ $field_group->index ][ $new_val['supporting_field_id'] ] = $new_val['supporting_field_value'];
654
+						$saved[ $field_group->index ][ $new_val[ 'supporting_field_id' ] ] = $new_val[ 'supporting_field_value' ];
655 655
 						// Reset var to the actual value
656
-						$new_val = $new_val['value'];
656
+						$new_val = $new_val[ 'value' ];
657 657
 					}
658 658
 				}
659 659
 
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
 				$is_removed = ( empty( $new_val ) && ! empty( $old_val ) );
667 667
 				// Compare values and add to `$updated` array
668 668
 				if ( $is_updated || $is_removed ) {
669
-					$this->updated[] = $base_id . '::' . $field_group->index . '::' . $sub_id;
669
+					$this->updated[ ] = $base_id . '::' . $field_group->index . '::' . $sub_id;
670 670
 				}
671 671
 
672 672
 				// Add to `$saved` array
@@ -701,22 +701,22 @@  discard block
 block discarded – undo
701 701
 		// Try to get our object ID from the global space
702 702
 		switch ( $this->object_type() ) {
703 703
 			case 'user':
704
-				$object_id = isset( $_REQUEST['user_id'] ) ? $_REQUEST['user_id'] : $object_id;
705
-				$object_id = ! $object_id && 'user-new.php' != $pagenow && isset( $GLOBALS['user_ID'] ) ? $GLOBALS['user_ID'] : $object_id;
704
+				$object_id = isset( $_REQUEST[ 'user_id' ] ) ? $_REQUEST[ 'user_id' ] : $object_id;
705
+				$object_id = ! $object_id && 'user-new.php' != $pagenow && isset( $GLOBALS[ 'user_ID' ] ) ? $GLOBALS[ 'user_ID' ] : $object_id;
706 706
 				break;
707 707
 
708 708
 			case 'comment':
709
-				$object_id = isset( $_REQUEST['c'] ) ? $_REQUEST['c'] : $object_id;
710
-				$object_id = ! $object_id && isset( $GLOBALS['comments']->comment_ID ) ? $GLOBALS['comments']->comment_ID : $object_id;
709
+				$object_id = isset( $_REQUEST[ 'c' ] ) ? $_REQUEST[ 'c' ] : $object_id;
710
+				$object_id = ! $object_id && isset( $GLOBALS[ 'comments' ]->comment_ID ) ? $GLOBALS[ 'comments' ]->comment_ID : $object_id;
711 711
 				break;
712 712
 
713 713
 			case 'term':
714
-				$object_id = isset( $_REQUEST['tag_ID'] ) ? $_REQUEST['tag_ID'] : $object_id;
714
+				$object_id = isset( $_REQUEST[ 'tag_ID' ] ) ? $_REQUEST[ 'tag_ID' ] : $object_id;
715 715
 				break;
716 716
 
717 717
 			default:
718
-				$object_id = isset( $GLOBALS['post']->ID ) ? $GLOBALS['post']->ID : $object_id;
719
-				$object_id = isset( $_REQUEST['post'] ) ? $_REQUEST['post'] : $object_id;
718
+				$object_id = isset( $GLOBALS[ 'post' ]->ID ) ? $GLOBALS[ 'post' ]->ID : $object_id;
719
+				$object_id = isset( $_REQUEST[ 'post' ] ) ? $_REQUEST[ 'post' ] : $object_id;
720 720
 				break;
721 721
 		}
722 722
 
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
 	 * @return boolean True/False
789 789
 	 */
790 790
 	public function is_options_page_mb() {
791
-		return ( isset( $this->meta_box['show_on']['key'] ) && 'options-page' === $this->meta_box['show_on']['key'] || array_key_exists( 'options-page', $this->meta_box['show_on'] ) );
791
+		return ( isset( $this->meta_box[ 'show_on' ][ 'key' ] ) && 'options-page' === $this->meta_box[ 'show_on' ][ 'key' ] || array_key_exists( 'options-page', $this->meta_box[ 'show_on' ] ) );
792 792
 	}
793 793
 
794 794
 	/**
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
 			return $field;
855 855
 		}
856 856
 
857
-		$field_id = is_string( $field ) ? $field : $field['id'];
857
+		$field_id = is_string( $field ) ? $field : $field[ 'id' ];
858 858
 
859 859
 		$parent_field_id = ! empty( $field_group ) ? $field_group->id() : '';
860 860
 		$ids = $this->get_field_ids( $field_id, $parent_field_id, true );
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
 		if ( $field_group && ( $sub_field_id || 0 === $sub_field_id ) ) {
891 891
 
892 892
 			// Update the fields array w/ any modified properties inherited from the group field
893
-			$this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ] = $field_args;
893
+			$this->meta_box[ 'fields' ][ $field_id ][ 'fields' ][ $sub_field_id ] = $field_args;
894 894
 
895 895
 			return array(
896 896
 				'field_args'  => $field_args,
@@ -900,11 +900,11 @@  discard block
 block discarded – undo
900 900
 		}
901 901
 
902 902
 		if ( is_array( $field_args ) ) {
903
-			$this->meta_box['fields'][ $field_id ] = array_merge( $field_args, $this->meta_box['fields'][ $field_id ] );
903
+			$this->meta_box[ 'fields' ][ $field_id ] = array_merge( $field_args, $this->meta_box[ 'fields' ][ $field_id ] );
904 904
 		}
905 905
 
906 906
 		return array(
907
-			'field_args'  => $this->meta_box['fields'][ $field_id ],
907
+			'field_args'  => $this->meta_box[ 'fields' ][ $field_id ],
908 908
 			'object_type' => $this->object_type(),
909 909
 			'object_id'   => $this->object_id(),
910 910
 		);
@@ -921,8 +921,8 @@  discard block
 block discarded – undo
921 921
 
922 922
 			$sub_fields = false;
923 923
 			if ( array_key_exists( 'fields', $field ) ) {
924
-				$sub_fields = $field['fields'];
925
-				unset( $field['fields'] );
924
+				$sub_fields = $field[ 'fields' ];
925
+				unset( $field[ 'fields' ] );
926 926
 			}
927 927
 
928 928
 			$field_id = $parent_field_id
@@ -949,11 +949,11 @@  discard block
 block discarded – undo
949 949
 
950 950
 		$this->_add_field_to_array(
951 951
 			$field,
952
-			$this->meta_box['fields'],
952
+			$this->meta_box[ 'fields' ],
953 953
 			$position
954 954
 		);
955 955
 
956
-		return $field['id'];
956
+		return $field[ 'id' ];
957 957
 	}
958 958
 
959 959
 	/**
@@ -965,27 +965,27 @@  discard block
 block discarded – undo
965 965
 	 * @return mixed                   Array of parent/field ids or false
966 966
 	 */
967 967
 	public function add_group_field( $parent_field_id, array $field, $position = 0 ) {
968
-		if ( ! array_key_exists( $parent_field_id, $this->meta_box['fields'] ) ) {
968
+		if ( ! array_key_exists( $parent_field_id, $this->meta_box[ 'fields' ] ) ) {
969 969
 			return false;
970 970
 		}
971 971
 
972
-		$parent_field = $this->meta_box['fields'][ $parent_field_id ];
972
+		$parent_field = $this->meta_box[ 'fields' ][ $parent_field_id ];
973 973
 
974
-		if ( 'group' !== $parent_field['type'] ) {
974
+		if ( 'group' !== $parent_field[ 'type' ] ) {
975 975
 			return false;
976 976
 		}
977 977
 
978
-		if ( ! isset( $parent_field['fields'] ) ) {
979
-			$this->meta_box['fields'][ $parent_field_id ]['fields'] = array();
978
+		if ( ! isset( $parent_field[ 'fields' ] ) ) {
979
+			$this->meta_box[ 'fields' ][ $parent_field_id ][ 'fields' ] = array();
980 980
 		}
981 981
 
982 982
 		$this->_add_field_to_array(
983 983
 			$field,
984
-			$this->meta_box['fields'][ $parent_field_id ]['fields'],
984
+			$this->meta_box[ 'fields' ][ $parent_field_id ][ 'fields' ],
985 985
 			$position
986 986
 		);
987 987
 
988
-		return array( $parent_field_id, $field['id'] );
988
+		return array( $parent_field_id, $field[ 'id' ] );
989 989
 	}
990 990
 
991 991
 	/**
@@ -997,9 +997,9 @@  discard block
 block discarded – undo
997 997
 	 */
998 998
 	protected function _add_field_to_array( $field, &$fields, $position = 0 ) {
999 999
 		if ( $position ) {
1000
-			cmb2_utils()->array_insert( $fields, array( $field['id'] => $field ), $position );
1000
+			cmb2_utils()->array_insert( $fields, array( $field[ 'id' ] => $field ), $position );
1001 1001
 		} else {
1002
-			$fields[ $field['id'] ] = $field;
1002
+			$fields[ $field[ 'id' ] ] = $field;
1003 1003
 		}
1004 1004
 	}
1005 1005
 
@@ -1022,12 +1022,12 @@  discard block
 block discarded – undo
1022 1022
 		unset( $this->fields[ implode( '', $ids ) ] );
1023 1023
 
1024 1024
 		if ( ! $sub_field_id ) {
1025
-			unset( $this->meta_box['fields'][ $field_id ] );
1025
+			unset( $this->meta_box[ 'fields' ][ $field_id ] );
1026 1026
 			return true;
1027 1027
 		}
1028 1028
 
1029
-		unset( $this->fields[ $field_id ]->args['fields'][ $sub_field_id ] );
1030
-		unset( $this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ] );
1029
+		unset( $this->fields[ $field_id ]->args[ 'fields' ][ $sub_field_id ] );
1030
+		unset( $this->meta_box[ 'fields' ][ $field_id ][ 'fields' ][ $sub_field_id ] );
1031 1031
 		return true;
1032 1032
 	}
1033 1033
 
@@ -1050,11 +1050,11 @@  discard block
 block discarded – undo
1050 1050
 		list( $field_id, $sub_field_id ) = $ids;
1051 1051
 
1052 1052
 		if ( ! $sub_field_id ) {
1053
-			$this->meta_box['fields'][ $field_id ][ $property ] = $value;
1053
+			$this->meta_box[ 'fields' ][ $field_id ][ $property ] = $value;
1054 1054
 			return $field_id;
1055 1055
 		}
1056 1056
 
1057
-		$this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ][ $property ] = $value;
1057
+		$this->meta_box[ 'fields' ][ $field_id ][ 'fields' ][ $sub_field_id ][ $property ] = $value;
1058 1058
 		return $field_id;
1059 1059
 	}
1060 1060
 
@@ -1068,7 +1068,7 @@  discard block
 block discarded – undo
1068 1068
 	public function get_field_ids( $field_id, $parent_field_id = '' ) {
1069 1069
 		$sub_field_id = $parent_field_id ? $field_id : '';
1070 1070
 		$field_id     = $parent_field_id ? $parent_field_id : $field_id;
1071
-		$fields       =& $this->meta_box['fields'];
1071
+		$fields       = & $this->meta_box[ 'fields' ];
1072 1072
 
1073 1073
 		if ( ! array_key_exists( $field_id, $fields ) ) {
1074 1074
 			$field_id = $this->search_old_school_array( $field_id, $fields );
@@ -1082,12 +1082,12 @@  discard block
 block discarded – undo
1082 1082
 			return array( $field_id, $sub_field_id );
1083 1083
 		}
1084 1084
 
1085
-		if ( 'group' !== $fields[ $field_id ]['type'] ) {
1085
+		if ( 'group' !== $fields[ $field_id ][ 'type' ] ) {
1086 1086
 			return false;
1087 1087
 		}
1088 1088
 
1089
-		if ( ! array_key_exists( $sub_field_id, $fields[ $field_id ]['fields'] ) ) {
1090
-			$sub_field_id = $this->search_old_school_array( $sub_field_id, $fields[ $field_id ]['fields'] );
1089
+		if ( ! array_key_exists( $sub_field_id, $fields[ $field_id ][ 'fields' ] ) ) {
1090
+			$sub_field_id = $this->search_old_school_array( $sub_field_id, $fields[ $field_id ][ 'fields' ] );
1091 1091
 		}
1092 1092
 
1093 1093
 		return false === $sub_field_id ? false : array( $field_id, $sub_field_id );
Please login to merge, or discard this patch.