Completed
Pull Request — trunk (#848)
by
unknown
04:35
created
example-functions.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 	$cmb_demo = new_cmb2_box( array(
116 116
 		'id'            => $prefix . 'metabox',
117 117
 		'title'         => esc_html__( 'Test Metabox', 'cmb2' ),
118
-		'object_types'  => array( 'page', ), // Post type
118
+		'object_types'  => array( 'page',), // Post type
119 119
 		// 'show_on_cb' => 'yourprefix_show_if_front_page', // function should return a bool value
120 120
 		// 'context'    => 'normal',
121 121
 		// 'priority'   => 'high',
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 		'desc'    => esc_html__( 'field description (optional)', 'cmb2' ),
386 386
 		'id'      => $prefix . 'wysiwyg',
387 387
 		'type'    => 'wysiwyg',
388
-		'options' => array( 'textarea_rows' => 5, ),
388
+		'options' => array( 'textarea_rows' => 5,),
389 389
 	) );
390 390
 
391 391
 	$cmb_demo->add_field( array(
@@ -441,11 +441,11 @@  discard block
 block discarded – undo
441 441
 	$cmb_about_page = new_cmb2_box( array(
442 442
 		'id'           => $prefix . 'metabox',
443 443
 		'title'        => esc_html__( 'About Page Metabox', 'cmb2' ),
444
-		'object_types' => array( 'page', ), // Post type
444
+		'object_types' => array( 'page',), // Post type
445 445
 		'context'      => 'normal',
446 446
 		'priority'     => 'high',
447 447
 		'show_names'   => true, // Show field names on the left
448
-		'show_on'      => array( 'id' => array( 2, ) ), // Specific post IDs to display this metabox
448
+		'show_on'      => array( 'id' => array( 2,) ), // Specific post IDs to display this metabox
449 449
 	) );
450 450
 
451 451
 	$cmb_about_page->add_field( array(
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 	$cmb_group = new_cmb2_box( array(
471 471
 		'id'           => $prefix . 'metabox',
472 472
 		'title'        => esc_html__( 'Repeating Field Group', 'cmb2' ),
473
-		'object_types' => array( 'page', ),
473
+		'object_types' => array( 'page',),
474 474
 	) );
475 475
 
476 476
 	// $group_field_id is the field id string, so in this case: $prefix . 'demo'
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
 	$cmb_rest = new_cmb2_box( array(
700 700
 		'id'            => $prefix . 'metabox',
701 701
 		'title'         => esc_html__( 'REST Test Box', 'cmb2' ),
702
-		'object_types'  => array( 'page', ), // Post type
702
+		'object_types'  => array( 'page',), // Post type
703 703
 		'show_in_rest' => WP_REST_Server::ALLMETHODS, // WP_REST_Server::READABLE|WP_REST_Server::EDITABLE, // Determines which HTTP methods the box is visible in.
704 704
 		// Optional callback to limit box visibility.
705 705
 		// See: https://github.com/WebDevStudios/CMB2/wiki/REST-API#permissions
Please login to merge, or discard this patch.
includes/CMB2_Types.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
 		// Check for methods to be proxied to the CMB2_Type_Base object.
55 55
 		if ( $exists = $this->maybe_proxy_method( $fieldtype, $arguments ) ) {
56
-			return $exists['value'];
56
+			return $exists[ 'value' ];
57 57
 		}
58 58
 
59 59
 		// Check for custom field type class.
@@ -448,8 +448,8 @@  discard block
 block discarded – undo
448 448
 			'class' => 'cmb2-hidden',
449 449
 		);
450 450
 		if ( $this->field->group ) {
451
-			$args['data-groupid'] = $this->field->group->id();
452
-			$args['data-iterator'] = $this->iterator;
451
+			$args[ 'data-groupid' ] = $this->field->group->id();
452
+			$args[ 'data-iterator' ] = $this->iterator;
453 453
 		}
454 454
 		return $this->input( $args );
455 455
 	}
Please login to merge, or discard this patch.
includes/types/CMB2_Type_Taxonomy_Radio.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 		if ( ! $terms ) {
25 25
 			$options .= sprintf( '<li><label>%s</label></li>', esc_html( $this->_text( 'no_terms_text', esc_html__( 'No terms', 'cmb2' ) ) ) );
26 26
 		} else {
27
-			$option_none  = $field->args( 'show_option_none' );
27
+			$option_none = $field->args( 'show_option_none' );
28 28
 			if ( ! empty( $option_none ) ) {
29 29
 
30 30
 				$field_id = $this->_id();
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 					'label' => $option_none,
55 55
 				);
56 56
 				if ( $saved_term == $option_none_value ) {
57
-					$args['checked'] = 'checked';
57
+					$args[ 'checked' ] = 'checked';
58 58
 				}
59 59
 				$options .= $this->list_input( $args, $i );
60 60
 				$i++;
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 				);
68 68
 
69 69
 				if ( $saved_term == $term->slug ) {
70
-					$args['checked'] = 'checked';
70
+					$args[ 'checked' ] = 'checked';
71 71
 				}
72 72
 				$options .= $this->list_input( $args, $i );
73 73
 				$i++;
Please login to merge, or discard this patch.
includes/CMB2_hookup.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
 		if ( $this->cmb->has_columns ) {
124 124
 			add_filter( 'manage_edit-comments_columns', array( $this, 'register_column_headers' ) );
125
-			add_action( 'manage_comments_custom_column', array( $this, 'column_display'  ), 10, 3 );
125
+			add_action( 'manage_comments_custom_column', array( $this, 'column_display' ), 10, 3 );
126 126
 		}
127 127
 	}
128 128
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 
140 140
 		if ( $this->cmb->has_columns ) {
141 141
 			add_filter( 'manage_users_columns', array( $this, 'register_column_headers' ) );
142
-			add_filter( 'manage_users_custom_column', array( $this, 'return_column_display'  ), 10, 3 );
142
+			add_filter( 'manage_users_custom_column', array( $this, 'return_column_display' ), 10, 3 );
143 143
 		}
144 144
 	}
145 145
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 
174 174
 			if ( $this->cmb->has_columns ) {
175 175
 				add_filter( "manage_edit-{$taxonomy}_columns", array( $this, 'register_column_headers' ) );
176
-				add_filter( "manage_{$taxonomy}_custom_column", array( $this, 'return_column_display'  ), 10, 3 );
176
+				add_filter( "manage_{$taxonomy}_custom_column", array( $this, 'return_column_display' ), 10, 3 );
177 177
 			}
178 178
 		}
179 179
 
@@ -266,25 +266,25 @@  discard block
 block discarded – undo
266 266
 		$fields = $this->cmb->prop( 'fields' );
267 267
 
268 268
 		foreach ( $fields as $key => $field ) {
269
-			if ( ! isset( $field['column'] ) ) {
269
+			if ( ! isset( $field[ 'column' ] ) ) {
270 270
 				continue;
271 271
 			}
272 272
 
273
-			$column = $field['column'];
273
+			$column = $field[ 'column' ];
274 274
 
275
-			if ( false === $column['position'] ) {
275
+			if ( false === $column[ 'position' ] ) {
276 276
 
277
-				$columns[ $field['id'] ] = $column['name'];
277
+				$columns[ $field[ 'id' ] ] = $column[ 'name' ];
278 278
 
279 279
 			} else {
280 280
 
281
-				$before = array_slice( $columns, 0, absint( $column['position'] ) );
282
-				$before[ $field['id'] ] = $column['name'];
281
+				$before = array_slice( $columns, 0, absint( $column[ 'position' ] ) );
282
+				$before[ $field[ 'id' ] ] = $column[ 'name' ];
283 283
 				$columns = $before + $columns;
284 284
 			}
285 285
 
286
-			$column['field'] = $field;
287
-			$this->columns[ $field['id'] ] = $column;
286
+			$column[ 'field' ] = $field;
287
+			$this->columns[ $field[ 'id' ] ] = $column;
288 288
 		}
289 289
 
290 290
 		return $columns;
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 	public function column_display( $column_name, $object_id ) {
298 298
 		if ( isset( $this->columns[ $column_name ] ) ) {
299 299
  			$field = new CMB2_Field( array(
300
-				'field_args'  => $this->columns[ $column_name ]['field'],
300
+				'field_args'  => $this->columns[ $column_name ][ 'field' ],
301 301
 				'object_type' => $this->object_type,
302 302
 				'object_id'   => $this->cmb->object_id( $object_id ),
303 303
 				'cmb_id'      => $this->cmb->cmb_id,
@@ -469,13 +469,13 @@  discard block
 block discarded – undo
469 469
 	 */
470 470
 	public function postbox_classes( $classes ) {
471 471
 		if ( $this->cmb->prop( 'closed' ) && ! in_array( 'closed', $classes ) ) {
472
-			$classes[] = 'closed';
472
+			$classes[ ] = 'closed';
473 473
 		}
474 474
 
475 475
 		if ( $this->cmb->is_alternate_context_box() ) {
476 476
 			$classes = $this->alternate_context_postbox_classes( $classes );
477 477
 		} else {
478
-			$classes[] = 'cmb2-postbox';
478
+			$classes[ ] = 'cmb2-postbox';
479 479
 		}
480 480
 
481 481
 		return $classes;
@@ -488,19 +488,19 @@  discard block
 block discarded – undo
488 488
 	 * @return array           Modified array of classes
489 489
 	 */
490 490
 	protected function alternate_context_postbox_classes( $classes ) {
491
-		$classes[] = 'context-box';
492
-		$classes[] = 'context-' . $this->cmb->prop( 'context' ) . '-box';
491
+		$classes[ ] = 'context-box';
492
+		$classes[ ] = 'context-' . $this->cmb->prop( 'context' ) . '-box';
493 493
 
494 494
 		if ( in_array( $this->cmb->cmb_id, get_hidden_meta_boxes( get_current_screen() ) ) ) {
495
-			$classes[] = 'hide-if-js';
495
+			$classes[ ] = 'hide-if-js';
496 496
 		}
497 497
 
498 498
 		$add_wrap = ! empty( $this->cmb->prop( 'title' ) ) || empty( $this->cmb->prop( 'remove_box_wrap' ) );
499 499
 
500 500
 		if ( $add_wrap ) {
501
-			$classes[] = 'cmb2-postbox postbox';
501
+			$classes[ ] = 'cmb2-postbox postbox';
502 502
 		} else {
503
-			$classes[] = 'cmb2-no-box-wrap';
503
+			$classes[ ] = 'cmb2-no-box-wrap';
504 504
 		}
505 505
 
506 506
 		return $classes;
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 	public function user_new_metabox( $section ) {
523 523
 		if ( $section == $this->cmb->prop( 'new_user_section' ) ) {
524 524
 			$object_id = $this->cmb->object_id();
525
-			$this->cmb->object_id( isset( $_REQUEST['user_id'] ) ? $_REQUEST['user_id'] : $object_id );
525
+			$this->cmb->object_id( isset( $_REQUEST[ 'user_id' ] ) ? $_REQUEST[ 'user_id' ] : $object_id );
526 526
 			$this->user_metabox();
527 527
 		}
528 528
 	}
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
 
704 704
 			$data_to_delete = array();
705 705
 			foreach ( $this->cmb->prop( 'fields' ) as $field ) {
706
-				$data_to_delete[ $field['id'] ] = '';
706
+				$data_to_delete[ $field[ 'id' ] ] = '';
707 707
 			}
708 708
 
709 709
 			$this->cmb->save_fields( $term_id, 'term', $data_to_delete );
Please login to merge, or discard this patch.
includes/CMB2.php 1 patch
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -123,19 +123,19 @@  discard block
 block discarded – undo
123 123
 	 */
124 124
 	public function __construct( $config, $object_id = 0 ) {
125 125
 
126
-		if ( empty( $config['id'] ) ) {
126
+		if ( empty( $config[ 'id' ] ) ) {
127 127
 			wp_die( esc_html__( 'Metabox configuration is required to have an ID parameter.', 'cmb2' ) );
128 128
 		}
129 129
 
130 130
 		$this->meta_box = wp_parse_args( $config, $this->mb_defaults );
131
-		$this->meta_box['fields'] = array();
131
+		$this->meta_box[ 'fields' ] = array();
132 132
 
133 133
 		$this->object_id( $object_id );
134 134
 		$this->mb_object_type();
135
-		$this->cmb_id = $config['id'];
135
+		$this->cmb_id = $config[ 'id' ];
136 136
 
137
-		if ( ! empty( $config['fields'] ) && is_array( $config['fields'] ) ) {
138
-			$this->add_fields( $config['fields'] );
137
+		if ( ! empty( $config[ 'fields' ] ) && is_array( $config[ 'fields' ] ) ) {
138
+			$this->add_fields( $config[ 'fields' ] );
139 139
 		}
140 140
 
141 141
 		CMB2_Boxes::add( $this );
@@ -243,17 +243,17 @@  discard block
 block discarded – undo
243 243
 
244 244
 			// Include custom class if requesting no title.
245 245
 			if ( ! $this->prop( 'title' ) && ! $this->prop( 'remove_box_wrap' ) ) {
246
-				$context[] = 'cmb2-context-wrap-no-title';
246
+				$context[ ] = 'cmb2-context-wrap-no-title';
247 247
 			}
248 248
 
249 249
 			// Include a generic context wrapper.
250
-			$context[] = 'cmb2-context-wrap';
250
+			$context[ ] = 'cmb2-context-wrap';
251 251
 
252 252
 			// Include a context-type based context wrapper.
253
-			$context[] = 'cmb2-context-wrap-' . $this->prop( 'context' );
253
+			$context[ ] = 'cmb2-context-wrap-' . $this->prop( 'context' );
254 254
 
255 255
 			// Include an ID based context wrapper as well.
256
-			$context[] = 'cmb2-context-wrap-' . $this->prop( 'id' );
256
+			$context[ ] = 'cmb2-context-wrap-' . $this->prop( 'id' );
257 257
 
258 258
 			// And merge all the classes back into the array.
259 259
 			$classes = array_merge( $classes, $context );
@@ -332,22 +332,22 @@  discard block
 block discarded – undo
332 332
 	 * @return mixed CMB2_Field object if successful.
333 333
 	 */
334 334
 	public function render_field( $field_args ) {
335
-		$field_args['context'] = $this->prop( 'context' );
335
+		$field_args[ 'context' ] = $this->prop( 'context' );
336 336
 
337
-		if ( 'group' == $field_args['type'] ) {
337
+		if ( 'group' == $field_args[ 'type' ] ) {
338 338
 
339
-			if ( ! isset( $field_args['show_names'] ) ) {
340
-				$field_args['show_names'] = $this->prop( 'show_names' );
339
+			if ( ! isset( $field_args[ 'show_names' ] ) ) {
340
+				$field_args[ 'show_names' ] = $this->prop( 'show_names' );
341 341
 			}
342 342
 			$field = $this->render_group( $field_args );
343 343
 
344
-		} elseif ( 'hidden' == $field_args['type'] && $this->get_field( $field_args )->should_show() ) {
344
+		} elseif ( 'hidden' == $field_args[ 'type' ] && $this->get_field( $field_args )->should_show() ) {
345 345
 			// Save rendering for after the metabox
346 346
 			$field = $this->add_hidden_field( $field_args );
347 347
 
348 348
 		} else {
349 349
 
350
-			$field_args['show_names'] = $this->prop( 'show_names' );
350
+			$field_args[ 'show_names' ] = $this->prop( 'show_names' );
351 351
 
352 352
 			// Render default fields
353 353
 			$field = $this->get_field( $field_args )->render_field();
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 	 */
364 364
 	public function render_group( $args ) {
365 365
 
366
-		if ( ! isset( $args['id'], $args['fields'] ) || ! is_array( $args['fields'] ) ) {
366
+		if ( ! isset( $args[ 'id' ], $args[ 'fields' ] ) || ! is_array( $args[ 'fields' ] ) ) {
367 367
 			return;
368 368
 		}
369 369
 
@@ -473,15 +473,15 @@  discard block
 block discarded – undo
473 473
 			<div class="inside cmb-td cmb-nested cmb-field-list">';
474 474
 				// Loop and render repeatable group fields
475 475
 				foreach ( array_values( $field_group->args( 'fields' ) ) as $field_args ) {
476
-					if ( 'hidden' == $field_args['type'] ) {
476
+					if ( 'hidden' == $field_args[ 'type' ] ) {
477 477
 
478 478
 						// Save rendering for after the metabox
479 479
 						$this->add_hidden_field( $field_args, $field_group );
480 480
 
481 481
 					} else {
482 482
 
483
-						$field_args['show_names'] = $field_group->args( 'show_names' );
484
-						$field_args['context']    = $field_group->args( 'context' );
483
+						$field_args[ 'show_names' ] = $field_group->args( 'show_names' );
484
+						$field_args[ 'context' ]    = $field_group->args( 'context' );
485 485
 
486 486
 						$field = $this->get_field( $field_args, $field_group )->render_field();
487 487
 					}
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 	 * @param CMB2_Field|null $field_group CMB2_Field group field object
511 511
 	 */
512 512
 	public function add_hidden_field( $field_args, $field_group = null ) {
513
-		if ( isset( $field_args['field_args'] ) ) {
513
+		if ( isset( $field_args[ 'field_args' ] ) ) {
514 514
 			// For back-compatibility.
515 515
 			$field = new CMB2_Field( $field_args );
516 516
 		} else {
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 			$types->iterator = $field_group->index;
524 524
 		}
525 525
 
526
-		$this->hidden_fields[] = $types;
526
+		$this->hidden_fields[ ] = $types;
527 527
 
528 528
 		return $field;
529 529
 	}
@@ -626,11 +626,11 @@  discard block
 block discarded – undo
626 626
 	 */
627 627
 	public function process_field( $field_args ) {
628 628
 
629
-		switch ( $field_args['type'] ) {
629
+		switch ( $field_args[ 'type' ] ) {
630 630
 
631 631
 			case 'group':
632 632
 				if ( $this->save_group( $field_args ) ) {
633
-					$this->updated[] = $field_args['id'];
633
+					$this->updated[ ] = $field_args[ 'id' ];
634 634
 				}
635 635
 
636 636
 				break;
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
 				$field = $this->get_new_field( $field_args );
645 645
 
646 646
 				if ( $field->save_field_from_data( $this->data_to_save ) ) {
647
-					$this->updated[] = $field->id();
647
+					$this->updated[ ] = $field->id();
648 648
 				}
649 649
 
650 650
 				break;
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
 	 * @return mixed        Return of CMB2_Field::update_data()
712 712
 	 */
713 713
 	public function save_group( $args ) {
714
-		if ( ! isset( $args['id'], $args['fields'] ) || ! is_array( $args['fields'] ) ) {
714
+		if ( ! isset( $args[ 'id' ], $args[ 'fields' ] ) || ! is_array( $args[ 'fields' ] ) ) {
715 715
 			return;
716 716
 		}
717 717
 
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
 		$field_group->data_to_save = $this->data_to_save;
741 741
 
742 742
 		foreach ( array_values( $field_group->fields() ) as $field_args ) {
743
-			if ( 'title' === $field_args['type'] ) {
743
+			if ( 'title' === $field_args[ 'type' ] ) {
744 744
 				// Don't process title fields
745 745
 				continue;
746 746
 			}
@@ -763,16 +763,16 @@  discard block
 block discarded – undo
763 763
 						$_new_val = array();
764 764
 						foreach ( $new_val as $group_index => $grouped_data ) {
765 765
 							// Add the supporting data to the $saved array stack
766
-							$saved[ $field_group->index ][ $grouped_data['supporting_field_id'] ][] = $grouped_data['supporting_field_value'];
766
+							$saved[ $field_group->index ][ $grouped_data[ 'supporting_field_id' ] ][ ] = $grouped_data[ 'supporting_field_value' ];
767 767
 							// Reset var to the actual value
768
-							$_new_val[ $group_index ] = $grouped_data['value'];
768
+							$_new_val[ $group_index ] = $grouped_data[ 'value' ];
769 769
 						}
770 770
 						$new_val = $_new_val;
771 771
 					} else {
772 772
 						// Add the supporting data to the $saved array stack
773
-						$saved[ $field_group->index ][ $new_val['supporting_field_id'] ] = $new_val['supporting_field_value'];
773
+						$saved[ $field_group->index ][ $new_val[ 'supporting_field_id' ] ] = $new_val[ 'supporting_field_value' ];
774 774
 						// Reset var to the actual value
775
-						$new_val = $new_val['value'];
775
+						$new_val = $new_val[ 'value' ];
776 776
 					}
777 777
 				}
778 778
 
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
 
787 787
 				// Compare values and add to `$updated` array
788 788
 				if ( $is_updated || $is_removed ) {
789
-					$this->updated[] = $base_id . '::' . $field_group->index . '::' . $sub_id;
789
+					$this->updated[ ] = $base_id . '::' . $field_group->index . '::' . $sub_id;
790 790
 				}
791 791
 
792 792
 				// Add to `$saved` array
@@ -823,22 +823,22 @@  discard block
 block discarded – undo
823 823
 		// Try to get our object ID from the global space
824 824
 		switch ( $this->object_type() ) {
825 825
 			case 'user':
826
-				$object_id = isset( $_REQUEST['user_id'] ) ? $_REQUEST['user_id'] : $object_id;
827
-				$object_id = ! $object_id && 'user-new.php' != $pagenow && isset( $GLOBALS['user_ID'] ) ? $GLOBALS['user_ID'] : $object_id;
826
+				$object_id = isset( $_REQUEST[ 'user_id' ] ) ? $_REQUEST[ 'user_id' ] : $object_id;
827
+				$object_id = ! $object_id && 'user-new.php' != $pagenow && isset( $GLOBALS[ 'user_ID' ] ) ? $GLOBALS[ 'user_ID' ] : $object_id;
828 828
 				break;
829 829
 
830 830
 			case 'comment':
831
-				$object_id = isset( $_REQUEST['c'] ) ? $_REQUEST['c'] : $object_id;
832
-				$object_id = ! $object_id && isset( $GLOBALS['comments']->comment_ID ) ? $GLOBALS['comments']->comment_ID : $object_id;
831
+				$object_id = isset( $_REQUEST[ 'c' ] ) ? $_REQUEST[ 'c' ] : $object_id;
832
+				$object_id = ! $object_id && isset( $GLOBALS[ 'comments' ]->comment_ID ) ? $GLOBALS[ 'comments' ]->comment_ID : $object_id;
833 833
 				break;
834 834
 
835 835
 			case 'term':
836
-				$object_id = isset( $_REQUEST['tag_ID'] ) ? $_REQUEST['tag_ID'] : $object_id;
836
+				$object_id = isset( $_REQUEST[ 'tag_ID' ] ) ? $_REQUEST[ 'tag_ID' ] : $object_id;
837 837
 				break;
838 838
 
839 839
 			default:
840
-				$object_id = isset( $GLOBALS['post']->ID ) ? $GLOBALS['post']->ID : $object_id;
841
-				$object_id = isset( $_REQUEST['post'] ) ? $_REQUEST['post'] : $object_id;
840
+				$object_id = isset( $GLOBALS[ 'post' ]->ID ) ? $GLOBALS[ 'post' ]->ID : $object_id;
841
+				$object_id = isset( $_REQUEST[ 'post' ] ) ? $_REQUEST[ 'post' ] : $object_id;
842 842
 				break;
843 843
 		}
844 844
 
@@ -909,7 +909,7 @@  discard block
 block discarded – undo
909 909
 	 * @return boolean True/False
910 910
 	 */
911 911
 	public function is_options_page_mb() {
912
-		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'] ) );
912
+		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' ] ) );
913 913
 	}
914 914
 
915 915
 	/**
@@ -953,7 +953,7 @@  discard block
 block discarded – undo
953 953
 			$type = 'term';
954 954
 		}
955 955
 
956
-		if ( defined( 'DOING_AJAX' ) && isset( $_POST['action'] ) && 'add-tag' === $_POST['action'] ) {
956
+		if ( defined( 'DOING_AJAX' ) && isset( $_POST[ 'action' ] ) && 'add-tag' === $_POST[ 'action' ] ) {
957 957
 			$type = 'term';
958 958
 		}
959 959
 
@@ -1000,7 +1000,7 @@  discard block
 block discarded – undo
1000 1000
 			return $field;
1001 1001
 		}
1002 1002
 
1003
-		$field_id = is_string( $field ) ? $field : $field['id'];
1003
+		$field_id = is_string( $field ) ? $field : $field[ 'id' ];
1004 1004
 
1005 1005
 		$parent_field_id = ! empty( $field_group ) ? $field_group->id() : '';
1006 1006
 		$ids = $this->get_field_ids( $field_id, $parent_field_id );
@@ -1036,16 +1036,16 @@  discard block
 block discarded – undo
1036 1036
 		if ( $field_group && ( $sub_field_id || 0 === $sub_field_id ) ) {
1037 1037
 
1038 1038
 			// Update the fields array w/ any modified properties inherited from the group field
1039
-			$this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ] = $field_args;
1039
+			$this->meta_box[ 'fields' ][ $field_id ][ 'fields' ][ $sub_field_id ] = $field_args;
1040 1040
 
1041 1041
 			return $this->get_default_args( $field_args, $field_group );
1042 1042
 		}
1043 1043
 
1044 1044
 		if ( is_array( $field_args ) ) {
1045
-			$this->meta_box['fields'][ $field_id ] = array_merge( $field_args, $this->meta_box['fields'][ $field_id ] );
1045
+			$this->meta_box[ 'fields' ][ $field_id ] = array_merge( $field_args, $this->meta_box[ 'fields' ][ $field_id ] );
1046 1046
 		}
1047 1047
 
1048
-		return $this->get_default_args( $this->meta_box['fields'][ $field_id ] );
1048
+		return $this->get_default_args( $this->meta_box[ 'fields' ][ $field_id ] );
1049 1049
 	}
1050 1050
 
1051 1051
 	/**
@@ -1095,8 +1095,8 @@  discard block
 block discarded – undo
1095 1095
 
1096 1096
 			$sub_fields = false;
1097 1097
 			if ( array_key_exists( 'fields', $field ) ) {
1098
-				$sub_fields = $field['fields'];
1099
-				unset( $field['fields'] );
1098
+				$sub_fields = $field[ 'fields' ];
1099
+				unset( $field[ 'fields' ] );
1100 1100
 			}
1101 1101
 
1102 1102
 			$field_id = $parent_field_id
@@ -1121,26 +1121,26 @@  discard block
 block discarded – undo
1121 1121
 			return false;
1122 1122
 		}
1123 1123
 
1124
-		if ( 'oembed' === $field['type'] ) {
1124
+		if ( 'oembed' === $field[ 'type' ] ) {
1125 1125
 			// Initiate oembed Ajax hooks
1126 1126
 			cmb2_ajax();
1127 1127
 		}
1128 1128
 
1129
-		if ( isset( $field['column'] ) && false !== $field['column'] ) {
1129
+		if ( isset( $field[ 'column' ] ) && false !== $field[ 'column' ] ) {
1130 1130
 			$field = $this->define_field_column( $field );
1131 1131
 		}
1132 1132
 
1133
-		if ( isset( $field['taxonomy'] ) && ! empty( $field['remove_default'] ) ) {
1134
-			$this->tax_metaboxes_to_remove[ $field['taxonomy'] ] = $field['taxonomy'];
1133
+		if ( isset( $field[ 'taxonomy' ] ) && ! empty( $field[ 'remove_default' ] ) ) {
1134
+			$this->tax_metaboxes_to_remove[ $field[ 'taxonomy' ] ] = $field[ 'taxonomy' ];
1135 1135
 		}
1136 1136
 
1137 1137
 		$this->_add_field_to_array(
1138 1138
 			$field,
1139
-			$this->meta_box['fields'],
1139
+			$this->meta_box[ 'fields' ],
1140 1140
 			$position
1141 1141
 		);
1142 1142
 
1143
-		return $field['id'];
1143
+		return $field[ 'id' ];
1144 1144
 	}
1145 1145
 
1146 1146
 	/**
@@ -1152,10 +1152,10 @@  discard block
 block discarded – undo
1152 1152
 	protected function define_field_column( array $field ) {
1153 1153
 		$this->has_columns = true;
1154 1154
 
1155
-		$column = is_array( $field['column'] ) ? $field['column'] : array();
1155
+		$column = is_array( $field[ 'column' ] ) ? $field[ 'column' ] : array();
1156 1156
 
1157
-		$field['column'] = wp_parse_args( $column, array(
1158
-			'name'     => isset( $field['name'] ) ? $field['name'] : '',
1157
+		$field[ 'column' ] = wp_parse_args( $column, array(
1158
+			'name'     => isset( $field[ 'name' ] ) ? $field[ 'name' ] : '',
1159 1159
 			'position' => false,
1160 1160
 		) );
1161 1161
 
@@ -1171,27 +1171,27 @@  discard block
 block discarded – undo
1171 1171
 	 * @return mixed                   Array of parent/field ids or false
1172 1172
 	 */
1173 1173
 	public function add_group_field( $parent_field_id, array $field, $position = 0 ) {
1174
-		if ( ! array_key_exists( $parent_field_id, $this->meta_box['fields'] ) ) {
1174
+		if ( ! array_key_exists( $parent_field_id, $this->meta_box[ 'fields' ] ) ) {
1175 1175
 			return false;
1176 1176
 		}
1177 1177
 
1178
-		$parent_field = $this->meta_box['fields'][ $parent_field_id ];
1178
+		$parent_field = $this->meta_box[ 'fields' ][ $parent_field_id ];
1179 1179
 
1180
-		if ( 'group' !== $parent_field['type'] ) {
1180
+		if ( 'group' !== $parent_field[ 'type' ] ) {
1181 1181
 			return false;
1182 1182
 		}
1183 1183
 
1184
-		if ( ! isset( $parent_field['fields'] ) ) {
1185
-			$this->meta_box['fields'][ $parent_field_id ]['fields'] = array();
1184
+		if ( ! isset( $parent_field[ 'fields' ] ) ) {
1185
+			$this->meta_box[ 'fields' ][ $parent_field_id ][ 'fields' ] = array();
1186 1186
 		}
1187 1187
 
1188 1188
 		$this->_add_field_to_array(
1189 1189
 			$field,
1190
-			$this->meta_box['fields'][ $parent_field_id ]['fields'],
1190
+			$this->meta_box[ 'fields' ][ $parent_field_id ][ 'fields' ],
1191 1191
 			$position
1192 1192
 		);
1193 1193
 
1194
-		return array( $parent_field_id, $field['id'] );
1194
+		return array( $parent_field_id, $field[ 'id' ] );
1195 1195
 	}
1196 1196
 
1197 1197
 	/**
@@ -1203,9 +1203,9 @@  discard block
 block discarded – undo
1203 1203
 	 */
1204 1204
 	protected function _add_field_to_array( $field, &$fields, $position = 0 ) {
1205 1205
 		if ( $position ) {
1206
-			CMB2_Utils::array_insert( $fields, array( $field['id'] => $field ), $position );
1206
+			CMB2_Utils::array_insert( $fields, array( $field[ 'id' ] => $field ), $position );
1207 1207
 		} else {
1208
-			$fields[ $field['id'] ] = $field;
1208
+			$fields[ $field[ 'id' ] ] = $field;
1209 1209
 		}
1210 1210
 	}
1211 1211
 
@@ -1228,15 +1228,15 @@  discard block
 block discarded – undo
1228 1228
 		unset( $this->fields[ implode( '', $ids ) ] );
1229 1229
 
1230 1230
 		if ( ! $sub_field_id ) {
1231
-			unset( $this->meta_box['fields'][ $field_id ] );
1231
+			unset( $this->meta_box[ 'fields' ][ $field_id ] );
1232 1232
 			return true;
1233 1233
 		}
1234 1234
 
1235
-		if ( isset( $this->fields[ $field_id ]->args['fields'][ $sub_field_id ] ) ) {
1236
-			unset( $this->fields[ $field_id ]->args['fields'][ $sub_field_id ] );
1235
+		if ( isset( $this->fields[ $field_id ]->args[ 'fields' ][ $sub_field_id ] ) ) {
1236
+			unset( $this->fields[ $field_id ]->args[ 'fields' ][ $sub_field_id ] );
1237 1237
 		}
1238
-		if ( isset( $this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ] ) ) {
1239
-			unset( $this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ] );
1238
+		if ( isset( $this->meta_box[ 'fields' ][ $field_id ][ 'fields' ][ $sub_field_id ] ) ) {
1239
+			unset( $this->meta_box[ 'fields' ][ $field_id ][ 'fields' ][ $sub_field_id ] );
1240 1240
 		}
1241 1241
 		return true;
1242 1242
 	}
@@ -1260,11 +1260,11 @@  discard block
 block discarded – undo
1260 1260
 		list( $field_id, $sub_field_id ) = $ids;
1261 1261
 
1262 1262
 		if ( ! $sub_field_id ) {
1263
-			$this->meta_box['fields'][ $field_id ][ $property ] = $value;
1263
+			$this->meta_box[ 'fields' ][ $field_id ][ $property ] = $value;
1264 1264
 			return $field_id;
1265 1265
 		}
1266 1266
 
1267
-		$this->meta_box['fields'][ $field_id ]['fields'][ $sub_field_id ][ $property ] = $value;
1267
+		$this->meta_box[ 'fields' ][ $field_id ][ 'fields' ][ $sub_field_id ][ $property ] = $value;
1268 1268
 		return $field_id;
1269 1269
 	}
1270 1270
 
@@ -1278,7 +1278,7 @@  discard block
 block discarded – undo
1278 1278
 	public function get_field_ids( $field_id, $parent_field_id = '' ) {
1279 1279
 		$sub_field_id = $parent_field_id ? $field_id : '';
1280 1280
 		$field_id     = $parent_field_id ? $parent_field_id : $field_id;
1281
-		$fields       =& $this->meta_box['fields'];
1281
+		$fields       = & $this->meta_box[ 'fields' ];
1282 1282
 
1283 1283
 		if ( ! array_key_exists( $field_id, $fields ) ) {
1284 1284
 			$field_id = $this->search_old_school_array( $field_id, $fields );
@@ -1292,12 +1292,12 @@  discard block
 block discarded – undo
1292 1292
 			return array( $field_id, $sub_field_id );
1293 1293
 		}
1294 1294
 
1295
-		if ( 'group' !== $fields[ $field_id ]['type'] ) {
1295
+		if ( 'group' !== $fields[ $field_id ][ 'type' ] ) {
1296 1296
 			return false;
1297 1297
 		}
1298 1298
 
1299
-		if ( ! array_key_exists( $sub_field_id, $fields[ $field_id ]['fields'] ) ) {
1300
-			$sub_field_id = $this->search_old_school_array( $sub_field_id, $fields[ $field_id ]['fields'] );
1299
+		if ( ! array_key_exists( $sub_field_id, $fields[ $field_id ][ 'fields' ] ) ) {
1300
+			$sub_field_id = $this->search_old_school_array( $sub_field_id, $fields[ $field_id ][ 'fields' ] );
1301 1301
 		}
1302 1302
 
1303 1303
 		return false === $sub_field_id ? false : array( $field_id, $sub_field_id );
Please login to merge, or discard this patch.
includes/CMB2_JS.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -56,23 +56,23 @@  discard block
 block discarded – undo
56 56
 		$min = $debug ? '' : '.min';
57 57
 
58 58
 		// if colorpicker
59
-		if ( ! is_admin() && isset( $dependencies['wp-color-picker'] ) ) {
59
+		if ( ! is_admin() && isset( $dependencies[ 'wp-color-picker' ] ) ) {
60 60
 			self::colorpicker_frontend();
61 61
 		}
62 62
 
63 63
 		// if file/file_list
64
-		if ( isset( $dependencies['media-editor'] ) ) {
64
+		if ( isset( $dependencies[ 'media-editor' ] ) ) {
65 65
 			wp_enqueue_media();
66 66
 		}
67 67
 
68 68
 		// if timepicker
69
-		if ( isset( $dependencies['jquery-ui-datetimepicker'] ) ) {
69
+		if ( isset( $dependencies[ 'jquery-ui-datetimepicker' ] ) ) {
70 70
 			wp_register_script( 'jquery-ui-datetimepicker', CMB2_Utils::url( 'js/jquery-ui-timepicker-addon.min.js' ), array( 'jquery-ui-slider' ), CMB2_VERSION );
71 71
 		}
72 72
 
73 73
 		// if cmb2-wysiwyg
74
-		$enqueue_wysiwyg = isset( $dependencies['cmb2-wysiwyg'] ) && $debug;
75
-		unset( $dependencies['cmb2-wysiwyg'] );
74
+		$enqueue_wysiwyg = isset( $dependencies[ 'cmb2-wysiwyg' ] ) && $debug;
75
+		unset( $dependencies[ 'cmb2-wysiwyg' ] );
76 76
 
77 77
 		// Enqueue cmb JS
78 78
 		wp_enqueue_script( self::$handle, CMB2_Utils::url( "js/cmb2{$min}.js" ), $dependencies, CMB2_VERSION, true );
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	 * @since  2.x.x.x
167 167
 	 */
168 168
 	public static function filter_media() {
169
-		add_filter( 'wp_prepare_attachment_for_js',  array( __CLASS__, 'prepare_image_sizes_for_js' ) , 10, 3 );
169
+		add_filter( 'wp_prepare_attachment_for_js', array( __CLASS__, 'prepare_image_sizes_for_js' ), 10, 3 );
170 170
 	}
171 171
 
172 172
 	/**
@@ -187,17 +187,17 @@  discard block
 block discarded – undo
187 187
 		
188 188
 		foreach ( $image_sizes as $size ) {
189 189
 			// registered image size exists for this attachment
190
-			if ( isset( $meta['sizes'][ $size ] ) ) {
190
+			if ( isset( $meta[ 'sizes' ][ $size ] ) ) {
191 191
 
192 192
 				$attachment_url = wp_get_attachment_url( $attachment->ID );
193 193
 				$base_url = str_replace( wp_basename( $attachment_url ), '', $attachment_url );
194
-				$size_meta = $meta['sizes'][ $size ];
194
+				$size_meta = $meta[ 'sizes' ][ $size ];
195 195
 
196
-				$response['sizes'][ $size ] = array(
197
-					'url'         => $base_url . $size_meta['file'],
198
-					'height'      => $size_meta['height'],
199
-					'width'       => $size_meta['width'],
200
-					'orientation' => $size_meta['height'] > $size_meta['width'] ? 'portrait' : 'landscape',
196
+				$response[ 'sizes' ][ $size ] = array(
197
+					'url'         => $base_url . $size_meta[ 'file' ],
198
+					'height'      => $size_meta[ 'height' ],
199
+					'width'       => $size_meta[ 'width' ],
200
+					'orientation' => $size_meta[ 'height' ] > $size_meta[ 'width' ] ? 'portrait' : 'landscape',
201 201
 				);
202 202
 			}
203 203
 		}
Please login to merge, or discard this patch.
includes/types/CMB2_Type_File.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 		$output      = '';
26 26
 
27 27
 		if ( is_array( $img_size ) ) {
28
-			$size_width  = $img_size[0];
29
-			$size_height = $img_size[1];
28
+			$size_width  = $img_size[ 0 ];
29
+			$size_height = $img_size[ 1 ];
30 30
 			
31 31
 			// Try and get the closest named size from our array of dimensions
32 32
 			if ( $named_size = CMB2_Utils::get_named_size( $img_size ) ) {
@@ -47,13 +47,13 @@  discard block
 block discarded – undo
47 47
 			}
48 48
 
49 49
 			// Get image dimensions from named sizes
50
-			$size_width  = $image_sizes[ $img_size ]['width'];
51
-			$size_height = $image_sizes[ $img_size ]['height'];
50
+			$size_width  = $image_sizes[ $img_size ][ 'width' ];
51
+			$size_height = $image_sizes[ $img_size ][ 'height' ];
52 52
 			$size_name   = $img_size;
53 53
 		}
54 54
 
55 55
 		// if options array and 'url' => false, then hide the url field
56
-		$input_type = array_key_exists( 'url', $options ) && false === $options['url'] ? 'hidden' : 'text';
56
+		$input_type = array_key_exists( 'url', $options ) && false === $options[ 'url' ] ? 'hidden' : 'text';
57 57
 
58 58
 		$output .= parent::render( array(
59 59
 			'type'  => $input_type,
Please login to merge, or discard this patch.
includes/types/CMB2_Type_File_List.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 		$output      = '';
26 26
 
27 27
 		if ( is_array( $img_size ) ) {
28
-			$size_width  = $img_size[0];
29
-			$size_height = $img_size[1];
28
+			$size_width  = $img_size[ 0 ];
29
+			$size_height = $img_size[ 1 ];
30 30
 
31 31
 			// Try and get the closest named size from our array of dimensions
32 32
 			if ( $named_size = CMB2_Utils::get_named_size( $img_size ) ) {
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 			}
48 48
 
49 49
 			// Get image dimensions from named sizes
50
-			$size_width  = $image_sizes[ $img_size ]['width'];
51
-			$size_height = $image_sizes[ $img_size ]['height'];
50
+			$size_width  = $image_sizes[ $img_size ][ 'width' ];
51
+			$size_height = $image_sizes[ $img_size ][ 'height' ];
52 52
 			$size_name   = $img_size;
53 53
 		}
54 54
 
Please login to merge, or discard this patch.
includes/CMB2_Utils.php 1 patch
Spacing   +28 added lines, -29 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 		$dir = wp_upload_dir();
38 38
 
39 39
 		// Is URL in uploads directory?
40
-		if ( false === strpos( $img_url, $dir['baseurl'] . '/' ) ) {
40
+		if ( false === strpos( $img_url, $dir[ 'baseurl' ] . '/' ) ) {
41 41
 			return false;
42 42
 		}
43 43
 
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 
63 63
 			foreach ( $query->posts as $post_id ) {
64 64
 				$meta = wp_get_attachment_metadata( $post_id );
65
-				$original_file       = basename( $meta['file'] );
66
-				$cropped_image_files = isset( $meta['sizes'] ) ? wp_list_pluck( $meta['sizes'], 'file' ) : array();
65
+				$original_file       = basename( $meta[ 'file' ] );
66
+				$cropped_image_files = isset( $meta[ 'sizes' ] ) ? wp_list_pluck( $meta[ 'sizes' ], 'file' ) : array();
67 67
 				if ( $original_file === $file || in_array( $file, $cropped_image_files ) ) {
68 68
 					$attachment_id = $post_id;
69 69
 					break;
@@ -125,15 +125,15 @@  discard block
 block discarded – undo
125 125
 			foreach ( $image_sizes as $_size => $data ) {
126 126
 
127 127
 				// If there's an exact match to an existing image size, short circuit.
128
-				if ( $data['width'] == $size[0] && $data['height'] == $size[1] ) {
129
-					$candidates[ $data['width'] * $data['height'] ] = array( $_size, $data );
128
+				if ( $data[ 'width' ] == $size[ 0 ] && $data[ 'height' ] == $size[ 1 ] ) {
129
+					$candidates[ $data[ 'width' ] * $data[ 'height' ] ] = array( $_size, $data );
130 130
 					break;
131 131
 				}
132 132
 
133 133
 				// If it's not an exact match, consider larger sizes with the same aspect ratio.
134
-				if ( $data['width'] >= $size[0] && $data['height'] >= $size[1] ) {
135
-					if ( wp_image_matches_ratio( $data['width'], $data['height'], $size[0], $size[1] ) ) {
136
-						$candidates[ $data['width'] * $data['height'] ] = array( $_size, $data );
134
+				if ( $data[ 'width' ] >= $size[ 0 ] && $data[ 'height' ] >= $size[ 1 ] ) {
135
+					if ( wp_image_matches_ratio( $data[ 'width' ], $data[ 'height' ], $size[ 0 ], $size[ 1 ] ) ) {
136
+						$candidates[ $data[ 'width' ] * $data[ 'height' ] ] = array( $_size, $data );
137 137
 					}
138 138
 				}
139 139
 			}
@@ -145,12 +145,12 @@  discard block
 block discarded – undo
145 145
 				}
146 146
 
147 147
 				$data = array_shift( $candidates );
148
-				$data = $data[0];
148
+				$data = $data[ 0 ];
149 149
 			/*
150 150
 			 * When the size requested is smaller than the thumbnail dimensions, we
151 151
 			 * fall back to the thumbnail size.
152 152
 			 */
153
-			} elseif ( ! empty( $image_sizes['thumbnail'] ) && $image_sizes['thumbnail']['width'] >= $size[0] && $image_sizes['thumbnail']['width'] >= $size[1] ) {
153
+			} elseif ( ! empty( $image_sizes[ 'thumbnail' ] ) && $image_sizes[ 'thumbnail' ][ 'width' ] >= $size[ 0 ] && $image_sizes[ 'thumbnail' ][ 'width' ] >= $size[ 1 ] ) {
154 154
 				$data = 'thumbnail';
155 155
 			} else {
156 156
 				return false;
@@ -240,8 +240,7 @@  discard block
 block discarded – undo
240 240
 		}
241 241
 
242 242
 		return self::is_valid_time_stamp( $string )
243
-			? (int) $string :
244
-			strtotime( (string) $string );
243
+			? (int) $string : strtotime( (string) $string );
245 244
 	}
246 245
 
247 246
 	/**
@@ -272,7 +271,7 @@  discard block
 block discarded – undo
272 271
 	 * @param  mixed $value Value to check
273 272
 	 * @return bool         True or false
274 273
 	 */
275
-	public static function notempty( $value ){
274
+	public static function notempty( $value ) {
276 275
 		return null !== $value && '' !== $value && false !== $value && array() !== $value;
277 276
 	}
278 277
 
@@ -430,24 +429,24 @@  discard block
 block discarded – undo
430 429
 
431 430
 		// order is relevant here, since the replacement will be done sequentially.
432 431
 		$supported_options = array(
433
-			'd' => 'dd',  // Day, leading 0
434
-			'j' => 'd',   // Day, no 0
435
-			'z' => 'o',   // Day of the year, no leading zeroes,
432
+			'd' => 'dd', // Day, leading 0
433
+			'j' => 'd', // Day, no 0
434
+			'z' => 'o', // Day of the year, no leading zeroes,
436 435
 			// 'D' => 'D',   // Day name short, not sure how it'll work with translations
437 436
 			// 'l' => 'DD',  // Day name full, idem before
438
-			'm' => 'mm',  // Month of the year, leading 0
439
-			'n' => 'm',   // Month of the year, no leading 0
437
+			'm' => 'mm', // Month of the year, leading 0
438
+			'n' => 'm', // Month of the year, no leading 0
440 439
 			// 'M' => 'M',   // Month, Short name
441 440
 			// 'F' => 'MM',  // Month, full name,
442
-			'y' => 'y',   // Year, two digit
443
-			'Y' => 'yy',  // Year, full
444
-			'H' => 'HH',  // Hour with leading 0 (24 hour)
445
-			'G' => 'H',   // Hour with no leading 0 (24 hour)
446
-			'h' => 'hh',  // Hour with leading 0 (12 hour)
447
-			'g' => 'h',   // Hour with no leading 0 (12 hour),
448
-			'i' => 'mm',  // Minute with leading 0,
449
-			's' => 'ss',  // Second with leading 0,
450
-			'a' => 'tt',  // am/pm
441
+			'y' => 'y', // Year, two digit
442
+			'Y' => 'yy', // Year, full
443
+			'H' => 'HH', // Hour with leading 0 (24 hour)
444
+			'G' => 'H', // Hour with no leading 0 (24 hour)
445
+			'h' => 'hh', // Hour with leading 0 (12 hour)
446
+			'g' => 'h', // Hour with no leading 0 (12 hour),
447
+			'i' => 'mm', // Minute with leading 0,
448
+			's' => 'ss', // Second with leading 0,
449
+			'a' => 'tt', // am/pm
451 450
 			'A' => 'TT'   // AM/PM
452 451
 		);
453 452
 
@@ -468,7 +467,7 @@  discard block
 block discarded – undo
468 467
 	 * @return string Modified value
469 468
 	 */
470 469
 	public static function wrap_escaped_chars( $value ) {
471
-		return "&#39;" . str_replace( '\\', '', $value[0] ) . "&#39;";
470
+		return "&#39;" . str_replace( '\\', '', $value[ 0 ] ) . "&#39;";
472 471
 	}
473 472
 
474 473
 	/**
@@ -527,7 +526,7 @@  discard block
 block discarded – undo
527 526
 	 * @return string               String of attributes for form element.
528 527
 	 */
529 528
 	public static function concat_attrs( $attrs, $attr_exclude = array() ) {
530
-		$attr_exclude[] = 'rendered';
529
+		$attr_exclude[ ] = 'rendered';
531 530
 		$attributes = '';
532 531
 		foreach ( $attrs as $attr => $val ) {
533 532
 			$excluded = in_array( $attr, (array) $attr_exclude, true );
Please login to merge, or discard this patch.