Completed
Push — trunk ( 6dacea...5870a5 )
by Justin
06:17
created
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.
@@ -481,8 +481,8 @@  discard block
 block discarded – undo
481 481
 			'class' => 'cmb2-hidden',
482 482
 		);
483 483
 		if ( $this->field->group ) {
484
-			$args['data-groupid'] = $this->field->group->id();
485
-			$args['data-iterator'] = $this->iterator;
484
+			$args[ 'data-groupid' ] = $this->field->group->id();
485
+			$args[ 'data-iterator' ] = $this->iterator;
486 486
 		}
487 487
 
488 488
 		return $this->get_new_render_type( __FUNCTION__, 'CMB2_Type_Text', $args, 'input' )->render();
Please login to merge, or discard this patch.
includes/helper-functions.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -90,18 +90,18 @@  discard block
 block discarded – undo
90 90
 	$oembed = cmb2_ajax()->get_oembed_no_edit( $args );
91 91
 
92 92
 	// Send back our embed
93
-	if ( $oembed['embed'] && $oembed['embed'] != $oembed['fallback'] ) {
94
-		return '<div class="cmb2-oembed">' . $oembed['embed'] . '</div>';
93
+	if ( $oembed[ 'embed' ] && $oembed[ 'embed' ] != $oembed[ 'fallback' ] ) {
94
+		return '<div class="cmb2-oembed">' . $oembed[ 'embed' ] . '</div>';
95 95
 	}
96 96
 
97 97
 	$error = sprintf(
98 98
 		/* translators: 1: results for. 2: link to codex.wordpress.org/Embeds */
99 99
 		esc_html__( 'No oEmbed Results Found for %1$s. View more info at %2$s.', 'cmb2' ),
100
-		$oembed['fallback'],
100
+		$oembed[ 'fallback' ],
101 101
 		'<a href="https://codex.wordpress.org/Embeds" target="_blank">codex.wordpress.org/Embeds</a>'
102 102
 	);
103 103
 
104
-	if ( isset( $args['wp_error'] ) && $args['wp_error'] ) {
104
+	if ( isset( $args[ 'wp_error' ] ) && $args[ 'wp_error' ] ) {
105 105
 		return new WP_Error( 'cmb2_get_oembed_result', $error, compact( 'oembed', 'args' ) );
106 106
 	}
107 107
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 		$cmb = CMB2_Boxes::get( $meta_box );
217 217
 	} else {
218 218
 		// See if we already have an instance of this metabox
219
-		$cmb = CMB2_Boxes::get( $meta_box['id'] );
219
+		$cmb = CMB2_Boxes::get( $meta_box[ 'id' ] );
220 220
 		// If not, we'll initate a new metabox
221 221
 		$cmb = $cmb ? $cmb : new CMB2( $meta_box, $object_id );
222 222
 	}
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 	) );
292 292
 
293 293
 	// Set object type explicitly (rather than trying to guess from context)
294
-	$cmb->object_type( $args['object_type'] );
294
+	$cmb->object_type( $args[ 'object_type' ] );
295 295
 
296 296
 	// Save the metabox if it's been submitted
297 297
 	// check permissions
@@ -299,32 +299,32 @@  discard block
 block discarded – undo
299 299
 	if (
300 300
 		$cmb->prop( 'save_fields' )
301 301
 		// check nonce
302
-		&& isset( $_POST['submit-cmb'], $_POST['object_id'], $_POST[ $cmb->nonce() ] )
302
+		&& isset( $_POST[ 'submit-cmb' ], $_POST[ 'object_id' ], $_POST[ $cmb->nonce() ] )
303 303
 		&& wp_verify_nonce( $_POST[ $cmb->nonce() ], $cmb->nonce() )
304
-		&& $object_id && $_POST['object_id'] == $object_id
304
+		&& $object_id && $_POST[ 'object_id' ] == $object_id
305 305
 	) {
306 306
 		$cmb->save_fields( $object_id, $cmb->object_type(), $_POST );
307 307
 	}
308 308
 
309 309
 	// Enqueue JS/CSS
310
-	if ( $args['cmb_styles'] ) {
310
+	if ( $args[ 'cmb_styles' ] ) {
311 311
 		CMB2_hookup::enqueue_cmb_css();
312 312
 	}
313 313
 
314
-	if ( $args['enqueue_js'] ) {
314
+	if ( $args[ 'enqueue_js' ] ) {
315 315
 		CMB2_hookup::enqueue_cmb_js();
316 316
 	}
317 317
 
318
-	$form_format = apply_filters( 'cmb2_get_metabox_form_format', $args['form_format'], $object_id, $cmb );
318
+	$form_format = apply_filters( 'cmb2_get_metabox_form_format', $args[ 'form_format' ], $object_id, $cmb );
319 319
 
320 320
 	$format_parts = explode( '%3$s', $form_format );
321 321
 
322 322
 	// Show cmb form
323
-	printf( $format_parts[0], $cmb->cmb_id, $object_id );
323
+	printf( $format_parts[ 0 ], $cmb->cmb_id, $object_id );
324 324
 	$cmb->show_form();
325 325
 
326
-	if ( isset( $format_parts[1] ) && $format_parts[1] ) {
327
-		printf( str_ireplace( '%4$s', '%1$s', $format_parts[1] ), $args['save_button'] );
326
+	if ( isset( $format_parts[ 1 ] ) && $format_parts[ 1 ] ) {
327
+		printf( str_ireplace( '%4$s', '%1$s', $format_parts[ 1 ] ), $args[ 'save_button' ] );
328 328
 	}
329 329
 
330 330
 }
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
  * @param  array   $args      Optional arguments array
338 338
  */
339 339
 function cmb2_metabox_form( $meta_box, $object_id = 0, $args = array() ) {
340
-	if ( ! isset( $args['echo'] ) || $args['echo'] ) {
340
+	if ( ! isset( $args[ 'echo' ] ) || $args[ 'echo' ] ) {
341 341
 		cmb2_print_metabox_form( $meta_box, $object_id, $args );
342 342
 	} else {
343 343
 		return cmb2_get_metabox_form( $meta_box, $object_id, $args );
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 
360 360
 		$schedule_format = str_replace(
361 361
 			array( 'M', 'Y', 'm', 'd', 'H', 'i', 'a' ),
362
-			array('%b', '%Y', '%m', '%d', '%H', '%M', '%p' ),
362
+			array( '%b', '%Y', '%m', '%d', '%H', '%M', '%p' ),
363 363
 			$date_format
364 364
 		);
365 365
 
@@ -376,14 +376,14 @@  discard block
 block discarded – undo
376 376
 			 * 4 or 2 characters, as needed
377 377
 			 */
378 378
 			'%04d-%02d-%02d %02d:%02d:%02d',
379
-			$parsed_time['tm_year'] + 1900,  // This will be "111", so we need to add 1900.
380
-			$parsed_time['tm_mon'] + 1,      // This will be the month minus one, so we add one.
381
-			$parsed_time['tm_mday'],
382
-			$parsed_time['tm_hour'],
383
-			$parsed_time['tm_min'],
384
-			$parsed_time['tm_sec']
379
+			$parsed_time[ 'tm_year' ] + 1900, // This will be "111", so we need to add 1900.
380
+			$parsed_time[ 'tm_mon' ] + 1, // This will be the month minus one, so we add one.
381
+			$parsed_time[ 'tm_mday' ],
382
+			$parsed_time[ 'tm_hour' ],
383
+			$parsed_time[ 'tm_min' ],
384
+			$parsed_time[ 'tm_sec' ]
385 385
 		);
386 386
 
387
-		return new DateTime($ymd);
387
+		return new DateTime( $ymd );
388 388
 	}
389 389
 }
Please login to merge, or discard this patch.
includes/CMB2_Field.php 1 patch
Spacing   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -112,21 +112,21 @@  discard block
 block discarded – undo
112 112
 	 */
113 113
 	public function __construct( $args ) {
114 114
 
115
-		if ( ! empty( $args['group_field'] ) ) {
116
-			$this->group       = $args['group_field'];
115
+		if ( ! empty( $args[ 'group_field' ] ) ) {
116
+			$this->group       = $args[ 'group_field' ];
117 117
 			$this->object_id   = $this->group->object_id;
118 118
 			$this->object_type = $this->group->object_type;
119 119
 			$this->cmb_id      = $this->group->cmb_id;
120 120
 		} else {
121
-			$this->object_id   = isset( $args['object_id'] ) && '_' !== $args['object_id'] ? $args['object_id'] : 0;
122
-			$this->object_type = isset( $args['object_type'] ) ? $args['object_type'] : 'post';
121
+			$this->object_id   = isset( $args[ 'object_id' ] ) && '_' !== $args[ 'object_id' ] ? $args[ 'object_id' ] : 0;
122
+			$this->object_type = isset( $args[ 'object_type' ] ) ? $args[ 'object_type' ] : 'post';
123 123
 
124
-			if ( isset( $args['cmb_id'] ) ) {
125
-				$this->cmb_id = $args['cmb_id'];
124
+			if ( isset( $args[ 'cmb_id' ] ) ) {
125
+				$this->cmb_id = $args[ 'cmb_id' ];
126 126
 			}
127 127
 		}
128 128
 
129
-		$this->args = $this->_set_field_defaults( $args['field_args'], $args );
129
+		$this->args = $this->_set_field_defaults( $args[ 'field_args' ], $args );
130 130
 
131 131
 		if ( $this->object_id ) {
132 132
 			$this->value = $this->get_data();
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 			return call_user_func_array( array( $this, 'get_string' ), $arguments );
146 146
 		}
147 147
 
148
-		$key = isset( $arguments[0] ) ? $arguments[0] : false;
148
+		$key = isset( $arguments[ 0 ] ) ? $arguments[ 0 ] : false;
149 149
 		return $this->args( $name, $key );
150 150
 	}
151 151
 
@@ -216,9 +216,9 @@  discard block
 block discarded – undo
216 216
 	 */
217 217
 	public function get_data( $field_id = '', $args = array() ) {
218 218
 		if ( $field_id ) {
219
-			$args['field_id'] = $field_id;
219
+			$args[ 'field_id' ] = $field_id;
220 220
 		} else if ( $this->group ) {
221
-			$args['field_id'] = $this->group->id();
221
+			$args[ 'field_id' ] = $this->group->id();
222 222
 		}
223 223
 
224 224
 		$a = $this->data_args( $args );
@@ -259,13 +259,13 @@  discard block
 block discarded – undo
259 259
 		 *
260 260
 		 * @since 2.0.0
261 261
 		 */
262
-		$data = apply_filters( "cmb2_override_{$a['field_id']}_meta_value", $data, $this->object_id, $a, $this );
262
+		$data = apply_filters( "cmb2_override_{$a[ 'field_id' ]}_meta_value", $data, $this->object_id, $a, $this );
263 263
 
264 264
 		// If no override, get value normally
265 265
 		if ( 'cmb2_field_no_override_val' === $data ) {
266
-			$data = 'options-page' === $a['type']
267
-				? cmb2_options( $a['id'] )->get( $a['field_id'] )
268
-				: get_metadata( $a['type'], $a['id'], $a['field_id'], ( $a['single'] || $a['repeat'] ) );
266
+			$data = 'options-page' === $a[ 'type' ]
267
+				? cmb2_options( $a[ 'id' ] )->get( $a[ 'field_id' ] )
268
+				: get_metadata( $a[ 'type' ], $a[ 'id' ], $a[ 'field_id' ], ( $a[ 'single' ] || $a[ 'repeat' ] ) );
269 269
 		}
270 270
 
271 271
 		if ( $this->group ) {
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 	public function update_data( $new_value, $single = true ) {
288 288
 		$a = $this->data_args( array( 'single' => $single ) );
289 289
 
290
-		$a['value'] = $a['repeat'] ? array_values( $new_value ) : $new_value;
290
+		$a[ 'value' ] = $a[ 'repeat' ] ? array_values( $new_value ) : $new_value;
291 291
 
292 292
 		/**
293 293
 		 * Filter whether to override saving of meta value.
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 		 *
324 324
 		 * @since 2.0.0
325 325
 		 */
326
-		$override = apply_filters( "cmb2_override_{$a['field_id']}_meta_save", $override, $a, $this->args(), $this );
326
+		$override = apply_filters( "cmb2_override_{$a[ 'field_id' ]}_meta_save", $override, $a, $this->args(), $this );
327 327
 
328 328
 		// If override, return that
329 329
 		if ( null !== $override ) {
@@ -331,22 +331,22 @@  discard block
 block discarded – undo
331 331
 		}
332 332
 
333 333
 		// Options page handling (or temp data store)
334
-		if ( 'options-page' === $a['type'] || empty( $a['id'] ) ) {
335
-			return cmb2_options( $a['id'] )->update( $a['field_id'], $a['value'], false, $a['single'] );
334
+		if ( 'options-page' === $a[ 'type' ] || empty( $a[ 'id' ] ) ) {
335
+			return cmb2_options( $a[ 'id' ] )->update( $a[ 'field_id' ], $a[ 'value' ], false, $a[ 'single' ] );
336 336
 		}
337 337
 
338 338
 		// Add metadata if not single
339
-		if ( ! $a['single'] ) {
340
-			return add_metadata( $a['type'], $a['id'], $a['field_id'], $a['value'], false );
339
+		if ( ! $a[ 'single' ] ) {
340
+			return add_metadata( $a[ 'type' ], $a[ 'id' ], $a[ 'field_id' ], $a[ 'value' ], false );
341 341
 		}
342 342
 
343 343
 		// Delete meta if we have an empty array
344
-		if ( is_array( $a['value'] ) && empty( $a['value'] ) ) {
345
-			return delete_metadata( $a['type'], $a['id'], $a['field_id'], $this->value );
344
+		if ( is_array( $a[ 'value' ] ) && empty( $a[ 'value' ] ) ) {
345
+			return delete_metadata( $a[ 'type' ], $a[ 'id' ], $a[ 'field_id' ], $this->value );
346 346
 		}
347 347
 
348 348
 		// Update metadata
349
-		return update_metadata( $a['type'], $a['id'], $a['field_id'], $a['value'] );
349
+		return update_metadata( $a[ 'type' ], $a[ 'id' ], $a[ 'field_id' ], $a[ 'value' ] );
350 350
 	}
351 351
 
352 352
 	/**
@@ -396,19 +396,19 @@  discard block
 block discarded – undo
396 396
 		 * @param array $field_args All field arguments
397 397
 		 * @param CMB2_Field object $field This field object
398 398
 		 */
399
-		$override = apply_filters( "cmb2_override_{$a['field_id']}_meta_remove", $override, $a, $this->args(), $this );
399
+		$override = apply_filters( "cmb2_override_{$a[ 'field_id' ]}_meta_remove", $override, $a, $this->args(), $this );
400 400
 
401 401
 		// If no override, remove as usual
402 402
 		if ( null !== $override ) {
403 403
 			return $override;
404 404
 		}
405 405
 		// Option page handling
406
-		elseif ( 'options-page' === $a['type'] || empty( $a['id'] ) ) {
407
-			return cmb2_options( $a['id'] )->remove( $a['field_id'] );
406
+		elseif ( 'options-page' === $a[ 'type' ] || empty( $a[ 'id' ] ) ) {
407
+			return cmb2_options( $a[ 'id' ] )->remove( $a[ 'field_id' ] );
408 408
 		}
409 409
 
410 410
 		// Remove metadata
411
-		return delete_metadata( $a['type'], $a['id'], $a['field_id'], $old );
411
+		return delete_metadata( $a[ 'type' ], $a[ 'id' ], $a[ 'field_id' ], $old );
412 412
 	}
413 413
 
414 414
 	/**
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
 
860 860
 		foreach ( $conditional_classes as $class => $condition ) {
861 861
 			if ( $condition ) {
862
-				$classes[] = $class;
862
+				$classes[ ] = $class;
863 863
 			}
864 864
 		}
865 865
 
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
 		}
871 871
 
872 872
 		if ( $added_classes ) {
873
-			$classes[] = esc_attr( $added_classes );
873
+			$classes[ ] = esc_attr( $added_classes );
874 874
 		}
875 875
 
876 876
 		/**
@@ -970,10 +970,10 @@  discard block
 block discarded – undo
970 970
 	public function get_string( $text_key, $fallback ) {
971 971
 		// If null, populate with our field strings values.
972 972
 		if ( null === $this->strings ) {
973
-			$this->strings = (array) $this->args['text'];
973
+			$this->strings = (array) $this->args[ 'text' ];
974 974
 
975
-			if ( is_callable( $this->args['text_cb'] ) ) {
976
-				$strings = call_user_func( $this->args['text_cb'], $this );
975
+			if ( is_callable( $this->args[ 'text_cb' ] ) ) {
976
+				$strings = call_user_func( $this->args[ 'text_cb' ], $this );
977 977
 
978 978
 				if ( $strings && is_array( $strings ) ) {
979 979
 					$this->strings += $strings;
@@ -1007,10 +1007,10 @@  discard block
 block discarded – undo
1007 1007
 			return $this->field_options;
1008 1008
 		}
1009 1009
 
1010
-		$this->field_options = (array) $this->args['options'];
1010
+		$this->field_options = (array) $this->args[ 'options' ];
1011 1011
 
1012
-		if ( is_callable( $this->args['options_cb'] ) ) {
1013
-			$options = call_user_func( $this->args['options_cb'], $this );
1012
+		if ( is_callable( $this->args[ 'options_cb' ] ) ) {
1013
+			$options = call_user_func( $this->args[ 'options_cb' ], $this );
1014 1014
 
1015 1015
 			if ( $options && is_array( $options ) ) {
1016 1016
 				$this->field_options = $options + $this->field_options;
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
 	 */
1032 1032
 	public function add_js_dependencies( $dependencies = array() ) {
1033 1033
 		foreach ( (array) $dependencies as $dependency ) {
1034
-			$this->args['js_dependencies'][ $dependency ] = $dependency;
1034
+			$this->args[ 'js_dependencies' ][ $dependency ] = $dependency;
1035 1035
 		}
1036 1036
 
1037 1037
 		CMB2_JS::add_dependencies( $dependencies );
@@ -1045,17 +1045,17 @@  discard block
 block discarded – undo
1045 1045
 	 * @return mixed  Default field value
1046 1046
 	 */
1047 1047
 	public function get_default() {
1048
-		if ( null !== $this->args['default'] ) {
1049
-			return $this->args['default'];
1048
+		if ( null !== $this->args[ 'default' ] ) {
1049
+			return $this->args[ 'default' ];
1050 1050
 		}
1051 1051
 
1052
-		$param = is_callable( $this->args['default_cb'] ) ? 'default_cb' : 'default';
1052
+		$param = is_callable( $this->args[ 'default_cb' ] ) ? 'default_cb' : 'default';
1053 1053
 		$default = $this->get_param_callback_result( $param );
1054 1054
 
1055 1055
 		// Allow a filter override of the default value
1056
-		$this->args['default'] = apply_filters( 'cmb2_default_filter', $default, $this );
1056
+		$this->args[ 'default' ] = apply_filters( 'cmb2_default_filter', $default, $this );
1057 1057
 
1058
-		return $this->args['default'];
1058
+		return $this->args[ 'default' ];
1059 1059
 	}
1060 1060
 
1061 1061
 	/**
@@ -1085,18 +1085,18 @@  discard block
 block discarded – undo
1085 1085
 			'classes_cb'        => '',
1086 1086
 			'select_all_button' => true,
1087 1087
 			'multiple'          => false,
1088
-			'repeatable'        => isset( $args['type'] ) && 'group' == $args['type'],
1088
+			'repeatable'        => isset( $args[ 'type' ] ) && 'group' == $args[ 'type' ],
1089 1089
 			'inline'            => false,
1090 1090
 			'on_front'          => true,
1091 1091
 			'show_names'        => true,
1092 1092
 			'save_field'        => true, // Will not save if false
1093 1093
 			'date_format'       => 'm\/d\/Y',
1094 1094
 			'time_format'       => 'h:i A',
1095
-			'description'       => isset( $args['desc'] ) ? $args['desc'] : '',
1096
-			'preview_size'      => 'file' == $args['type'] ? array( 350, 350 ) : array( 50, 50 ),
1095
+			'description'       => isset( $args[ 'desc' ] ) ? $args[ 'desc' ] : '',
1096
+			'preview_size'      => 'file' == $args[ 'type' ] ? array( 350, 350 ) : array( 50, 50 ),
1097 1097
 			'render_row_cb'     => array( $this, 'render_field_callback' ),
1098 1098
 			'display_cb'        => array( $this, 'display_value_callback' ),
1099
-			'label_cb'          => 'title' != $args['type'] ? array( $this, 'label' ) : '',
1099
+			'label_cb'          => 'title' != $args[ 'type' ] ? array( $this, 'label' ) : '',
1100 1100
 			'column'            => false,
1101 1101
 			'js_dependencies'   => array(),
1102 1102
 			'show_in_rest'      => null,
@@ -1111,44 +1111,44 @@  discard block
 block discarded – undo
1111 1111
 		 */
1112 1112
 		$args = $this->convert_deprecated_params( $args );
1113 1113
 
1114
-		$args['repeatable'] = $args['repeatable'] && ! $this->repeatable_exception( $args['type'] );
1115
-		$args['inline']     = $args['inline'] || false !== stripos( $args['type'], '_inline' );
1114
+		$args[ 'repeatable' ] = $args[ 'repeatable' ] && ! $this->repeatable_exception( $args[ 'type' ] );
1115
+		$args[ 'inline' ]     = $args[ 'inline' ] || false !== stripos( $args[ 'type' ], '_inline' );
1116 1116
 
1117
-		$args['options']    = 'group' == $args['type'] ? wp_parse_args( $args['options'], array(
1117
+		$args[ 'options' ]    = 'group' == $args[ 'type' ] ? wp_parse_args( $args[ 'options' ], array(
1118 1118
 			'add_button'    => esc_html__( 'Add Group', 'cmb2' ),
1119 1119
 			'remove_button' => esc_html__( 'Remove Group', 'cmb2' ),
1120
-		) ) : $args['options'];
1120
+		) ) : $args[ 'options' ];
1121 1121
 
1122
-		$args['_id']        = $args['id'];
1123
-		$args['_name']      = $args['id'];
1122
+		$args[ '_id' ]        = $args[ 'id' ];
1123
+		$args[ '_name' ]      = $args[ 'id' ];
1124 1124
 
1125 1125
 		if ( $this->group ) {
1126 1126
 
1127
-			$args['id']    = $this->group->args( 'id' ) . '_' . $this->group->index . '_' . $args['id'];
1128
-			$args['_name'] = $this->group->args( 'id' ) . '[' . $this->group->index . '][' . $args['_name'] . ']';
1127
+			$args[ 'id' ]    = $this->group->args( 'id' ) . '_' . $this->group->index . '_' . $args[ 'id' ];
1128
+			$args[ '_name' ] = $this->group->args( 'id' ) . '[' . $this->group->index . '][' . $args[ '_name' ] . ']';
1129 1129
 		}
1130 1130
 
1131
-		if ( 'wysiwyg' == $args['type'] ) {
1132
-			$args['id'] = strtolower( str_ireplace( '-', '_', $args['id'] ) );
1133
-			$args['options']['textarea_name'] = $args['_name'];
1131
+		if ( 'wysiwyg' == $args[ 'type' ] ) {
1132
+			$args[ 'id' ] = strtolower( str_ireplace( '-', '_', $args[ 'id' ] ) );
1133
+			$args[ 'options' ][ 'textarea_name' ] = $args[ '_name' ];
1134 1134
 		}
1135 1135
 
1136 1136
 		$option_types = apply_filters( 'cmb2_all_or_nothing_types', array( 'select', 'radio', 'radio_inline', 'taxonomy_select', 'taxonomy_radio', 'taxonomy_radio_inline' ), $this );
1137 1137
 
1138
-		if ( in_array( $args['type'], $option_types, true ) ) {
1138
+		if ( in_array( $args[ 'type' ], $option_types, true ) ) {
1139 1139
 
1140
-			$args['show_option_none'] = isset( $args['show_option_none'] ) ? $args['show_option_none'] : null;
1141
-			$args['show_option_none'] = true === $args['show_option_none'] ? esc_html__( 'None', 'cmb2' ) : $args['show_option_none'];
1140
+			$args[ 'show_option_none' ] = isset( $args[ 'show_option_none' ] ) ? $args[ 'show_option_none' ] : null;
1141
+			$args[ 'show_option_none' ] = true === $args[ 'show_option_none' ] ? esc_html__( 'None', 'cmb2' ) : $args[ 'show_option_none' ];
1142 1142
 
1143
-			if ( null === $args['show_option_none'] ) {
1144
-				$off_by_default = in_array( $args['type'], array( 'select', 'radio', 'radio_inline' ), true );
1145
-				$args['show_option_none'] = $off_by_default ? false : esc_html__( 'None', 'cmb2' );
1143
+			if ( null === $args[ 'show_option_none' ] ) {
1144
+				$off_by_default = in_array( $args[ 'type' ], array( 'select', 'radio', 'radio_inline' ), true );
1145
+				$args[ 'show_option_none' ] = $off_by_default ? false : esc_html__( 'None', 'cmb2' );
1146 1146
 			}
1147 1147
 
1148 1148
 		}
1149 1149
 
1150
-		$args['has_supporting_data'] = in_array(
1151
-			$args['type'],
1150
+		$args[ 'has_supporting_data' ] = in_array(
1151
+			$args[ 'type' ],
1152 1152
 			array(
1153 1153
 				// CMB2_Sanitize::_save_file_id_value()/CMB2_Sanitize::_get_group_file_value_array()
1154 1154
 				'file',
@@ -1171,10 +1171,10 @@  discard block
 block discarded – undo
1171 1171
 	protected function get_default_args( $field_args, $field_group = null ) {
1172 1172
 		$args = parent::get_default_args( array(), $this->group );
1173 1173
 
1174
-		if ( isset( $field_args['field_args'] ) ) {
1174
+		if ( isset( $field_args[ 'field_args' ] ) ) {
1175 1175
 			$args = wp_parse_args( $field_args, $args );
1176 1176
 		} else {
1177
-			$args['field_args'] = wp_parse_args( $field_args, $this->args );
1177
+			$args[ 'field_args' ] = wp_parse_args( $field_args, $this->args );
1178 1178
 		}
1179 1179
 
1180 1180
 		return $args;
@@ -1217,43 +1217,43 @@  discard block
 block discarded – undo
1217 1217
 	 */
1218 1218
 	protected function convert_deprecated_params( $args ) {
1219 1219
 
1220
-		if ( isset( $args['row_classes'] ) ) {
1220
+		if ( isset( $args[ 'row_classes' ] ) ) {
1221 1221
 
1222 1222
 			// We'll let this one be.
1223 1223
 			// $this->deprecated_param( __CLASS__ . '::__construct()', '2.2.3', self::DEPRECATED_PARAM, 'row_classes', 'classes' );
1224 1224
 
1225 1225
 			// row_classes param could be a callback. This is definitely deprecated.
1226
-			if ( is_callable( $args['row_classes'] ) ) {
1226
+			if ( is_callable( $args[ 'row_classes' ] ) ) {
1227 1227
 
1228 1228
 				$this->deprecated_param( __CLASS__ . '::__construct()', '2.2.3', self::DEPRECATED_CB_PARAM, 'row_classes', 'classes_cb' );
1229 1229
 
1230
-				$args['classes_cb'] = $args['row_classes'];
1231
-				$args['classes'] = null;
1230
+				$args[ 'classes_cb' ] = $args[ 'row_classes' ];
1231
+				$args[ 'classes' ] = null;
1232 1232
 			} else {
1233 1233
 
1234
-				$args['classes'] = $args['row_classes'];
1234
+				$args[ 'classes' ] = $args[ 'row_classes' ];
1235 1235
 			}
1236 1236
 
1237
-			unset( $args['row_classes'] );
1237
+			unset( $args[ 'row_classes' ] );
1238 1238
 		}
1239 1239
 
1240 1240
 
1241 1241
 		// default param can be passed a callback as well
1242
-		if ( is_callable( $args['default'] ) ) {
1242
+		if ( is_callable( $args[ 'default' ] ) ) {
1243 1243
 
1244 1244
 			$this->deprecated_param( __CLASS__ . '::__construct()', '2.2.3', self::DEPRECATED_CB_PARAM, 'default', 'default_cb' );
1245 1245
 
1246
-			$args['default_cb'] = $args['default'];
1247
-			$args['default'] = null;
1246
+			$args[ 'default_cb' ] = $args[ 'default' ];
1247
+			$args[ 'default' ] = null;
1248 1248
 		}
1249 1249
 
1250 1250
 		// options param can be passed a callback as well
1251
-		if ( is_callable( $args['options'] ) ) {
1251
+		if ( is_callable( $args[ 'options' ] ) ) {
1252 1252
 
1253 1253
 			$this->deprecated_param( __CLASS__ . '::__construct()', '2.2.3', self::DEPRECATED_CB_PARAM, 'options', 'options_cb' );
1254 1254
 
1255
-			$args['options_cb'] = $args['options'];
1256
-			$args['options'] = array();
1255
+			$args[ 'options_cb' ] = $args[ 'options' ];
1256
+			$args[ 'options' ] = array();
1257 1257
 		}
1258 1258
 
1259 1259
 		return $args;
Please login to merge, or discard this patch.
includes/CMB2_JS.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -56,23 +56,23 @@
 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 );
Please login to merge, or discard this patch.
includes/types/CMB2_Type_Oembed.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 			'data-objecttype' => $field->object_type,
34 34
 		) )
35 35
 		. '<p class="cmb-spinner spinner"></p>'
36
-		. '<div id="'. $this->_id( '-status' ). '" class="cmb2-media-status ui-helper-clearfix embed_wrap">' . $oembed . '</div>';
36
+		. '<div id="' . $this->_id( '-status' ) . '" class="cmb2-media-status ui-helper-clearfix embed_wrap">' . $oembed . '</div>';
37 37
 	}
38 38
 
39 39
 }
Please login to merge, or discard this patch.
includes/types/CMB2_Type_File_Base.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
 	 */
56 56
 	public function img_status_output( $args ) {
57 57
 		return sprintf( '<%1$s class="img-status cmb2-media-item">%2$s<p class="cmb2-remove-wrapper"><a href="#" class="cmb2-remove-file-button"%3$s>%4$s</a></p>%5$s</%1$s>',
58
-			$args['tag'],
59
-			$args['image'],
60
-			isset( $args['cached_id'] ) ? ' rel="' . $args['cached_id'] . '"' : '',
58
+			$args[ 'tag' ],
59
+			$args[ 'image' ],
60
+			isset( $args[ 'cached_id' ] ) ? ' rel="' . $args[ 'cached_id' ] . '"' : '',
61 61
 			esc_html( $this->_text( 'remove_image_text', esc_html__( 'Remove Image', 'cmb2' ) ) ),
62
-			isset( $args['id_input'] ) ? $args['id_input'] : ''
62
+			isset( $args[ 'id_input' ] ) ? $args[ 'id_input' ] : ''
63 63
 		);
64 64
 	}
65 65
 
@@ -71,14 +71,14 @@  discard block
 block discarded – undo
71 71
 	 */
72 72
 	public function file_status_output( $args ) {
73 73
 		return sprintf( '<%1$s class="file-status cmb2-media-item"><span>%2$s <strong>%3$s</strong></span>&nbsp;&nbsp; (<a href="%4$s" target="_blank" rel="external">%5$s</a> / <a href="#" class="cmb2-remove-file-button"%6$s>%7$s</a>)%8$s</%1$s>',
74
-			$args['tag'],
74
+			$args[ 'tag' ],
75 75
 			esc_html( $this->_text( 'file_text', esc_html__( 'File:', 'cmb2' ) ) ),
76
-			CMB2_Utils::get_file_name_from_path( $args['value'] ),
77
-			$args['value'],
76
+			CMB2_Utils::get_file_name_from_path( $args[ 'value' ] ),
77
+			$args[ 'value' ],
78 78
 			esc_html( $this->_text( 'file_download_text', esc_html__( 'Download', 'cmb2' ) ) ),
79
-			isset( $args['cached_id'] ) ? ' rel="' . $args['cached_id'] . '"' : '',
79
+			isset( $args[ 'cached_id' ] ) ? ' rel="' . $args[ 'cached_id' ] . '"' : '',
80 80
 			esc_html( $this->_text( 'remove_text', esc_html__( 'Remove', 'cmb2' ) ) ),
81
-			isset( $args['id_input'] ) ? $args['id_input'] : ''
81
+			isset( $args[ 'id_input' ] ) ? $args[ 'id_input' ] : ''
82 82
 		);
83 83
 	}
84 84
 
Please login to merge, or discard this patch.
includes/types/CMB2_Type_Select_Timezone.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 
15 15
 	public function render() {
16 16
 
17
-		$this->field->args['default'] = $this->field->get_default()
17
+		$this->field->args[ 'default' ] = $this->field->get_default()
18 18
 			? $this->field->get_default()
19 19
 			: CMB2_Utils::timezone_string();
20 20
 
Please login to merge, or discard this patch.
includes/types/CMB2_Type_Taxonomy_Multicheck.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 				);
37 37
 
38 38
 				if ( is_array( $saved_terms ) && in_array( $term->slug, $saved_terms ) ) {
39
-					$args['checked'] = 'checked';
39
+					$args[ 'checked' ] = 'checked';
40 40
 				}
41 41
 				$options .= $this->list_input( $args, $i );
42 42
 				$i++;
Please login to merge, or discard this patch.
includes/types/CMB2_Type_Multi_Base.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	 * @return string       Generated option element html
20 20
 	 */
21 21
 	public function select_option( $args = array() ) {
22
-		return sprintf( "\t" . '<option value="%s" %s>%s</option>', $args['value'], selected( isset( $args['checked'] ) && $args['checked'], true, false ), $args['label'] ) . "\n";
22
+		return sprintf( "\t" . '<option value="%s" %s>%s</option>', $args[ 'value' ], selected( isset( $args[ 'checked' ] ) && $args[ 'checked' ], true, false ), $args[ 'label' ] ) . "\n";
23 23
 	}
24 24
 
25 25
 	/**
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 			'label' => '',
40 40
 		), $args );
41 41
 
42
-		return sprintf( "\t" . '<li><input%s/> <label for="%s">%s</label></li>' . "\n", $this->concat_attrs( $a, array( 'label' ) ), $a['id'], $a['label'] );
42
+		return sprintf( "\t" . '<li><input%s/> <label for="%s">%s</label></li>' . "\n", $this->concat_attrs( $a, array( 'label' ) ), $a[ 'id' ], $a[ 'label' ] );
43 43
 	}
44 44
 
45 45
 	/**
@@ -51,10 +51,10 @@  discard block
 block discarded – undo
51 51
 	 */
52 52
 	public function list_input_checkbox( $args, $i ) {
53 53
 		$saved_value = $this->field->escaped_value();
54
-		if ( is_array( $saved_value ) && in_array( $args['value'], $saved_value ) ) {
55
-			$args['checked'] = 'checked';
54
+		if ( is_array( $saved_value ) && in_array( $args[ 'value' ], $saved_value ) ) {
55
+			$args[ 'checked' ] = 'checked';
56 56
 		}
57
-		$args['type'] = 'checkbox';
57
+		$args[ 'type' ] = 'checkbox';
58 58
 		return $this->list_input( $args, $i );
59 59
 	}
60 60
 
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
 	public function concat_items( $args = array() ) {
68 68
 		$field = $this->field;
69 69
 
70
-		$method = isset( $args['method'] ) ? $args['method'] : 'select_option';
71
-		unset( $args['method'] );
70
+		$method = isset( $args[ 'method' ] ) ? $args[ 'method' ] : 'select_option';
71
+		unset( $args[ 'method' ] );
72 72
 
73 73
 		$value = null !== $field->escaped_value()
74 74
 			? $field->escaped_value()
@@ -90,12 +90,12 @@  discard block
 block discarded – undo
90 90
 			// Clone args & modify for just this item
91 91
 			$a = $args;
92 92
 
93
-			$a['value'] = $opt_value;
94
-			$a['label'] = $opt_label;
93
+			$a[ 'value' ] = $opt_value;
94
+			$a[ 'label' ] = $opt_label;
95 95
 
96 96
 			// Check if this option is the value of the input
97 97
 			if ( $value === $opt_value ) {
98
-				$a['checked'] = 'checked';
98
+				$a[ 'checked' ] = 'checked';
99 99
 			}
100 100
 
101 101
 			$concatenated_items .= $this->$method( $a, $i++ );
Please login to merge, or discard this patch.