Completed
Push — trunk ( 5f30a5...1b3e25 )
by Justin
05:04
created
includes/types/CMB2_Type_Base.php 1 patch
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,6 @@  discard block
 block discarded – undo
84 84
 
85 85
 	/**
86 86
 	 * Fall back to CMB2_Types methods
87
-	 * @param string $field
88 87
 	 * @throws Exception Throws an exception if the field is invalid.
89 88
 	 * @return mixed
90 89
 	 */
@@ -105,7 +104,7 @@  discard block
 block discarded – undo
105 104
 	 * Magic getter for our object.
106 105
 	 * @param string $field
107 106
 	 * @throws Exception Throws an exception if the field is invalid.
108
-	 * @return mixed
107
+	 * @return CMB2_Field
109 108
 	 */
110 109
 	public function __get( $field ) {
111 110
 		switch ( $field ) {
Please login to merge, or discard this patch.
includes/types/CMB2_Type_Text_Datetime_Timestamp.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -38,6 +38,9 @@  discard block
 block discarded – undo
38 38
 		return $date_input . "\n" . $time_input;
39 39
 	}
40 40
 
41
+	/**
42
+	 * @param boolean $has_good_value
43
+	 */
41 44
 	public function date_args( $args, $has_good_value ) {
42 45
 		$date_args = wp_parse_args( $args['datepicker'], array(
43 46
 			'class' => 'cmb2-text-small cmb2-datepicker',
@@ -51,6 +54,9 @@  discard block
 block discarded – undo
51 54
 		return $this->parse_picker_options( 'date', $date_args );
52 55
 	}
53 56
 
57
+	/**
58
+	 * @param boolean $has_good_value
59
+	 */
54 60
 	public function time_args( $args, $has_good_value ) {
55 61
 		$time_args = wp_parse_args( $args['timepicker'], array(
56 62
 			'class' => 'cmb2-timepicker text-time',
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -22,16 +22,16 @@  discard block
 block discarded – undo
22 22
 			'timepicker' => array(),
23 23
 		) );
24 24
 
25
-		if ( empty( $args['value'] ) ) {
26
-			$args['value'] = $field->escaped_value();
25
+		if ( empty( $args[ 'value' ] ) ) {
26
+			$args[ 'value' ] = $field->escaped_value();
27 27
 			// This will be used if there is a select_timezone set for this field
28 28
 			$tz_offset = $field->field_timezone_offset();
29 29
 			if ( ! empty( $tz_offset ) ) {
30
-				$args['value'] -= $tz_offset;
30
+				$args[ 'value' ] -= $tz_offset;
31 31
 			}
32 32
 		}
33 33
 
34
-		$has_good_value = ! empty( $args['value'] ) && ! is_array( $args['value'] );
34
+		$has_good_value = ! empty( $args[ 'value' ] ) && ! is_array( $args[ 'value' ] );
35 35
 
36 36
 		$date_input = parent::render( $this->date_args( $args, $has_good_value ) );
37 37
 		$time_input = parent::render( $this->time_args( $args, $has_good_value ) );
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
 	}
40 40
 
41 41
 	public function date_args( $args, $has_good_value ) {
42
-		$date_args = wp_parse_args( $args['datepicker'], array(
42
+		$date_args = wp_parse_args( $args[ 'datepicker' ], array(
43 43
 			'class' => 'cmb2-text-small cmb2-datepicker',
44 44
 			'name'  => $this->_name( '[date]' ),
45 45
 			'id'    => $this->_id( '_date' ),
46
-			'value' => $has_good_value ? $this->field->get_timestamp_format( 'date_format', $args['value'] ) : '',
46
+			'value' => $has_good_value ? $this->field->get_timestamp_format( 'date_format', $args[ 'value' ] ) : '',
47 47
 			'desc'  => '',
48 48
 		) );
49 49
 
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
 	}
53 53
 
54 54
 	public function time_args( $args, $has_good_value ) {
55
-		$time_args = wp_parse_args( $args['timepicker'], array(
55
+		$time_args = wp_parse_args( $args[ 'timepicker' ], array(
56 56
 			'class' => 'cmb2-timepicker text-time',
57 57
 			'name'  => $this->_name( '[time]' ),
58 58
 			'id'    => $this->_id( '_time' ),
59
-			'value' => $has_good_value ? $this->field->get_timestamp_format( 'time_format', $args['value'] ) : '',
60
-			'desc'  => $args['desc'],
59
+			'value' => $has_good_value ? $this->field->get_timestamp_format( 'time_format', $args[ 'value' ] ) : '',
60
+			'desc'  => $args[ 'desc' ],
61 61
 			'js_dependencies' => array( 'jquery-ui-core', 'jquery-ui-datepicker', 'jquery-ui-datetimepicker' ),
62 62
 		) );
63 63
 
Please login to merge, or discard this patch.
includes/types/CMB2_Type_Textarea_Code.php 1 patch
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,6 @@
 block discarded – undo
15 15
 	/**
16 16
 	 * Handles outputting an 'textarea' element
17 17
 	 * @since  1.1.0
18
-	 * @param  array  $args Override arguments
19 18
 	 * @return string       Form textarea element
20 19
 	 */
21 20
 	public function render() {
Please login to merge, or discard this patch.
includes/types/CMB2_Type_Wysiwyg.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,6 @@
 block discarded – undo
15 15
 	/**
16 16
 	 * Handles outputting a 'wysiwyg' element
17 17
 	 * @since  1.1.0
18
-	 * @param  array  $args Override arguments
19 18
 	 * @return string       Form wysiwyg element
20 19
 	 */
21 20
 	public function render() {
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * CMB wysiwyg field type
4
- *
5
- * @since  2.2.2
6
- *
7
- * @category  WordPress_Plugin
8
- * @package   CMB2
9
- * @author    WebDevStudios
10
- * @license   GPL-2.0+
11
- * @link      http://webdevstudios.com
12
- */
3
+	 * CMB wysiwyg field type
4
+	 *
5
+	 * @since  2.2.2
6
+	 *
7
+	 * @category  WordPress_Plugin
8
+	 * @package   CMB2
9
+	 * @author    WebDevStudios
10
+	 * @license   GPL-2.0+
11
+	 * @link      http://webdevstudios.com
12
+	 */
13 13
 class CMB2_Type_Wysiwyg extends CMB2_Type_Base {
14 14
 
15 15
 	/**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 			'options' => $this->field->options(),
27 27
 		) );
28 28
 
29
-		wp_editor( $a['value'], $a['id'], $a['options'] );
30
-		echo $a['desc'];
29
+		wp_editor( $a[ 'value' ], $a[ 'id' ], $a[ 'options' ] );
30
+		echo $a[ 'desc' ];
31 31
 	}
32 32
 }
Please login to merge, or discard this patch.
includes/helper-functions.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * CMB2 Helper Functions
4
- *
5
- * @category  WordPress_Plugin
6
- * @package   CMB2
7
- * @author    WebDevStudios
8
- * @license   GPL-2.0+
9
- * @link      http://webdevstudios.com
10
- */
3
+	 * CMB2 Helper Functions
4
+	 *
5
+	 * @category  WordPress_Plugin
6
+	 * @package   CMB2
7
+	 * @author    WebDevStudios
8
+	 * @license   GPL-2.0+
9
+	 * @link      http://webdevstudios.com
10
+	 */
11 11
 
12 12
 /**
13 13
  * Helper function to provide directory path to CMB2
Please login to merge, or discard this patch.
includes/CMB2_Field.php 1 patch
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -93,16 +93,16 @@  discard block
 block discarded – undo
93 93
 	 */
94 94
 	public function __construct( $args ) {
95 95
 
96
-		if ( ! empty( $args['group_field'] ) ) {
97
-			$this->group       = $args['group_field'];
96
+		if ( ! empty( $args[ 'group_field' ] ) ) {
97
+			$this->group       = $args[ 'group_field' ];
98 98
 			$this->object_id   = $this->group->object_id;
99 99
 			$this->object_type = $this->group->object_type;
100 100
 		} else {
101
-			$this->object_id   = isset( $args['object_id'] ) && '_' !== $args['object_id'] ? $args['object_id'] : 0;
102
-			$this->object_type = isset( $args['object_type'] ) ? $args['object_type'] : 'post';
101
+			$this->object_id   = isset( $args[ 'object_id' ] ) && '_' !== $args[ 'object_id' ] ? $args[ 'object_id' ] : 0;
102
+			$this->object_type = isset( $args[ 'object_type' ] ) ? $args[ 'object_type' ] : 'post';
103 103
 		}
104 104
 
105
-		$this->args = $this->_set_field_defaults( $args['field_args'] );
105
+		$this->args = $this->_set_field_defaults( $args[ 'field_args' ] );
106 106
 
107 107
 		if ( $this->object_id ) {
108 108
 			$this->value = $this->get_data();
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 * @return mixed             Value of field argument
118 118
 	 */
119 119
 	public function __call( $name, $arguments ) {
120
-		$key = isset( $arguments[0] ) ? $arguments[0] : false;
120
+		$key = isset( $arguments[ 0 ] ) ? $arguments[ 0 ] : false;
121 121
 		return $this->args( $name, $key );
122 122
 	}
123 123
 
@@ -188,9 +188,9 @@  discard block
 block discarded – undo
188 188
 	 */
189 189
 	public function get_data( $field_id = '', $args = array() ) {
190 190
 		if ( $field_id ) {
191
-			$args['field_id'] = $field_id;
191
+			$args[ 'field_id' ] = $field_id;
192 192
 		} else if ( $this->group ) {
193
-			$args['field_id'] = $this->group->id();
193
+			$args[ 'field_id' ] = $this->group->id();
194 194
 		}
195 195
 
196 196
 		$a = $this->data_args( $args );
@@ -231,13 +231,13 @@  discard block
 block discarded – undo
231 231
 		 *
232 232
 		 * @since 2.0.0
233 233
 		 */
234
-		$data = apply_filters( "cmb2_override_{$a['field_id']}_meta_value", $data, $this->object_id, $a, $this );
234
+		$data = apply_filters( "cmb2_override_{$a[ 'field_id' ]}_meta_value", $data, $this->object_id, $a, $this );
235 235
 
236 236
 		// If no override, get value normally
237 237
 		if ( 'cmb2_field_no_override_val' === $data ) {
238
-			$data = 'options-page' === $a['type']
239
-				? cmb2_options( $a['id'] )->get( $a['field_id'] )
240
-				: get_metadata( $a['type'], $a['id'], $a['field_id'], ( $a['single'] || $a['repeat'] ) );
238
+			$data = 'options-page' === $a[ 'type' ]
239
+				? cmb2_options( $a[ 'id' ] )->get( $a[ 'field_id' ] )
240
+				: get_metadata( $a[ 'type' ], $a[ 'id' ], $a[ 'field_id' ], ( $a[ 'single' ] || $a[ 'repeat' ] ) );
241 241
 		}
242 242
 
243 243
 		if ( $this->group ) {
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 	public function update_data( $new_value, $single = true ) {
260 260
 		$a = $this->data_args( array( 'single' => $single ) );
261 261
 
262
-		$a['value'] = $a['repeat'] ? array_values( $new_value ) : $new_value;
262
+		$a[ 'value' ] = $a[ 'repeat' ] ? array_values( $new_value ) : $new_value;
263 263
 
264 264
 		/**
265 265
 		 * Filter whether to override saving of meta value.
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 		 *
296 296
 		 * @since 2.0.0
297 297
 		 */
298
-		$override = apply_filters( "cmb2_override_{$a['field_id']}_meta_save", $override, $a, $this->args(), $this );
298
+		$override = apply_filters( "cmb2_override_{$a[ 'field_id' ]}_meta_save", $override, $a, $this->args(), $this );
299 299
 
300 300
 		// If override, return that
301 301
 		if ( null !== $override ) {
@@ -303,22 +303,22 @@  discard block
 block discarded – undo
303 303
 		}
304 304
 
305 305
 		// Options page handling (or temp data store)
306
-		if ( 'options-page' === $a['type'] || empty( $a['id'] ) ) {
307
-			return cmb2_options( $a['id'] )->update( $a['field_id'], $a['value'], false, $a['single'] );
306
+		if ( 'options-page' === $a[ 'type' ] || empty( $a[ 'id' ] ) ) {
307
+			return cmb2_options( $a[ 'id' ] )->update( $a[ 'field_id' ], $a[ 'value' ], false, $a[ 'single' ] );
308 308
 		}
309 309
 
310 310
 		// Add metadata if not single
311
-		if ( ! $a['single'] ) {
312
-			return add_metadata( $a['type'], $a['id'], $a['field_id'], $a['value'], false );
311
+		if ( ! $a[ 'single' ] ) {
312
+			return add_metadata( $a[ 'type' ], $a[ 'id' ], $a[ 'field_id' ], $a[ 'value' ], false );
313 313
 		}
314 314
 
315 315
 		// Delete meta if we have an empty array
316
-		if ( is_array( $a['value'] ) && empty( $a['value'] ) ) {
317
-			return delete_metadata( $a['type'], $a['id'], $a['field_id'], $this->value );
316
+		if ( is_array( $a[ 'value' ] ) && empty( $a[ 'value' ] ) ) {
317
+			return delete_metadata( $a[ 'type' ], $a[ 'id' ], $a[ 'field_id' ], $this->value );
318 318
 		}
319 319
 
320 320
 		// Update metadata
321
-		return update_metadata( $a['type'], $a['id'], $a['field_id'], $a['value'] );
321
+		return update_metadata( $a[ 'type' ], $a[ 'id' ], $a[ 'field_id' ], $a[ 'value' ] );
322 322
 	}
323 323
 
324 324
 	/**
@@ -368,19 +368,19 @@  discard block
 block discarded – undo
368 368
 		 * @param array $field_args All field arguments
369 369
 		 * @param CMB2_Field object $field This field object
370 370
 		 */
371
-		$override = apply_filters( "cmb2_override_{$a['field_id']}_meta_remove", $override, $a, $this->args(), $this );
371
+		$override = apply_filters( "cmb2_override_{$a[ 'field_id' ]}_meta_remove", $override, $a, $this->args(), $this );
372 372
 
373 373
 		// If no override, remove as usual
374 374
 		if ( null !== $override ) {
375 375
 			return $override;
376 376
 		}
377 377
 		// Option page handling
378
-		elseif ( 'options-page' === $a['type'] || empty( $a['id'] ) ) {
379
-			return cmb2_options( $a['id'] )->remove( $a['field_id'] );
378
+		elseif ( 'options-page' === $a[ 'type' ] || empty( $a[ 'id' ] ) ) {
379
+			return cmb2_options( $a[ 'id' ] )->remove( $a[ 'field_id' ] );
380 380
 		}
381 381
 
382 382
 		// Remove metadata
383
-		return delete_metadata( $a['type'], $a['id'], $a['field_id'], $old );
383
+		return delete_metadata( $a[ 'type' ], $a[ 'id' ], $a[ 'field_id' ], $old );
384 384
 	}
385 385
 
386 386
 	/**
@@ -851,7 +851,7 @@  discard block
 block discarded – undo
851 851
 
852 852
 		foreach ( $conditional_classes as $class => $condition ) {
853 853
 			if ( $condition ) {
854
-				$classes[] = $class;
854
+				$classes[ ] = $class;
855 855
 			}
856 856
 		}
857 857
 
@@ -860,7 +860,7 @@  discard block
 block discarded – undo
860 860
 		}
861 861
 
862 862
 		if ( $added_classes ) {
863
-			$classes[] = esc_attr( $added_classes );
863
+			$classes[ ] = esc_attr( $added_classes );
864 864
 		}
865 865
 
866 866
 		/**
@@ -965,10 +965,10 @@  discard block
 block discarded – undo
965 965
 			return $this->field_options;
966 966
 		}
967 967
 
968
-		$this->field_options = (array) $this->args['options'];
968
+		$this->field_options = (array) $this->args[ 'options' ];
969 969
 
970
-		if ( is_callable( $this->args['options_cb'] ) ) {
971
-			$options = call_user_func( $this->args['options_cb'], $this );
970
+		if ( is_callable( $this->args[ 'options_cb' ] ) ) {
971
+			$options = call_user_func( $this->args[ 'options_cb' ], $this );
972 972
 
973 973
 			if ( $options && is_array( $options ) ) {
974 974
 				$this->field_options += $options;
@@ -990,17 +990,17 @@  discard block
 block discarded – undo
990 990
 	 * @return mixed  Default field value
991 991
 	 */
992 992
 	public function get_default() {
993
-		if ( null !== $this->args['default'] ) {
994
-			return $this->args['default'];
993
+		if ( null !== $this->args[ 'default' ] ) {
994
+			return $this->args[ 'default' ];
995 995
 		}
996 996
 
997
-		$param = is_callable( $this->args['default_cb'] ) ? 'default_cb' : 'default';
997
+		$param = is_callable( $this->args[ 'default_cb' ] ) ? 'default_cb' : 'default';
998 998
 		$default = $this->get_param_callback_result( $param, false );
999 999
 
1000 1000
 		// Allow a filter override of the default value
1001
-		$this->args['default'] = apply_filters( 'cmb2_default_filter', $default, $this );
1001
+		$this->args[ 'default' ] = apply_filters( 'cmb2_default_filter', $default, $this );
1002 1002
 
1003
-		return $this->args['default'];
1003
+		return $this->args[ 'default' ];
1004 1004
 	}
1005 1005
 
1006 1006
 	/**
@@ -1025,68 +1025,68 @@  discard block
 block discarded – undo
1025 1025
 			'default_cb'        => '',
1026 1026
 			'select_all_button' => true,
1027 1027
 			'multiple'          => false,
1028
-			'repeatable'        => isset( $args['type'] ) && 'group' == $args['type'],
1028
+			'repeatable'        => isset( $args[ 'type' ] ) && 'group' == $args[ 'type' ],
1029 1029
 			'inline'            => false,
1030 1030
 			'on_front'          => true,
1031 1031
 			'show_names'        => true,
1032 1032
 			'date_format'       => 'm\/d\/Y',
1033 1033
 			'time_format'       => 'h:i A',
1034
-			'description'       => isset( $args['desc'] ) ? $args['desc'] : '',
1035
-			'preview_size'      => 'file' == $args['type'] ? array( 350, 350 ) : array( 50, 50 ),
1034
+			'description'       => isset( $args[ 'desc' ] ) ? $args[ 'desc' ] : '',
1035
+			'preview_size'      => 'file' == $args[ 'type' ] ? array( 350, 350 ) : array( 50, 50 ),
1036 1036
 			'render_row_cb'     => array( $this, 'render_field_callback' ),
1037
-			'label_cb'          => 'title' != $args['type'] ? array( $this, 'label' ) : '',
1037
+			'label_cb'          => 'title' != $args[ 'type' ] ? array( $this, 'label' ) : '',
1038 1038
 		) );
1039 1039
 
1040 1040
 		// default param can be passed a callback as well
1041
-		if ( is_callable( $args['default'] ) ) {
1042
-			$args['default_cb'] = $args['default'];
1043
-			$args['default'] = null;
1041
+		if ( is_callable( $args[ 'default' ] ) ) {
1042
+			$args[ 'default_cb' ] = $args[ 'default' ];
1043
+			$args[ 'default' ] = null;
1044 1044
 		}
1045 1045
 
1046
-		$args['repeatable'] = $args['repeatable'] && ! $this->repeatable_exception( $args['type'] );
1047
-		$args['inline']     = $args['inline'] || false !== stripos( $args['type'], '_inline' );
1046
+		$args[ 'repeatable' ] = $args[ 'repeatable' ] && ! $this->repeatable_exception( $args[ 'type' ] );
1047
+		$args[ 'inline' ]     = $args[ 'inline' ] || false !== stripos( $args[ 'type' ], '_inline' );
1048 1048
 
1049 1049
 		// options param can be passed a callback as well
1050
-		if ( is_callable( $args['options'] ) ) {
1051
-			$args['options_cb'] = $args['options'];
1052
-			$args['options'] = array();
1050
+		if ( is_callable( $args[ 'options' ] ) ) {
1051
+			$args[ 'options_cb' ] = $args[ 'options' ];
1052
+			$args[ 'options' ] = array();
1053 1053
 		}
1054 1054
 
1055
-		$args['options']    = 'group' == $args['type'] ? wp_parse_args( $args['options'], array(
1055
+		$args[ 'options' ] = 'group' == $args[ 'type' ] ? wp_parse_args( $args[ 'options' ], array(
1056 1056
 			'add_button'    => __( 'Add Group', 'cmb2' ),
1057 1057
 			'remove_button' => __( 'Remove Group', 'cmb2' ),
1058
-		) ) : $args['options'];
1058
+		) ) : $args[ 'options' ];
1059 1059
 
1060
-		$args['_id']        = $args['id'];
1061
-		$args['_name']      = $args['id'];
1060
+		$args[ '_id' ]        = $args[ 'id' ];
1061
+		$args[ '_name' ]      = $args[ 'id' ];
1062 1062
 
1063 1063
 		if ( $this->group ) {
1064 1064
 
1065
-			$args['id']    = $this->group->args( 'id' ) . '_' . $this->group->index . '_' . $args['id'];
1066
-			$args['_name'] = $this->group->args( 'id' ) . '[' . $this->group->index . '][' . $args['_name'] . ']';
1065
+			$args[ 'id' ]    = $this->group->args( 'id' ) . '_' . $this->group->index . '_' . $args[ 'id' ];
1066
+			$args[ '_name' ] = $this->group->args( 'id' ) . '[' . $this->group->index . '][' . $args[ '_name' ] . ']';
1067 1067
 		}
1068 1068
 
1069
-		if ( 'wysiwyg' == $args['type'] ) {
1070
-			$args['id'] = strtolower( str_ireplace( '-', '_', $args['id'] ) );
1071
-			$args['options']['textarea_name'] = $args['_name'];
1069
+		if ( 'wysiwyg' == $args[ 'type' ] ) {
1070
+			$args[ 'id' ] = strtolower( str_ireplace( '-', '_', $args[ 'id' ] ) );
1071
+			$args[ 'options' ][ 'textarea_name' ] = $args[ '_name' ];
1072 1072
 		}
1073 1073
 
1074 1074
 		$option_types = apply_filters( 'cmb2_all_or_nothing_types', array( 'select', 'radio', 'radio_inline', 'taxonomy_select', 'taxonomy_radio', 'taxonomy_radio_inline' ), $this );
1075 1075
 
1076
-		if ( in_array( $args['type'], $option_types, true ) ) {
1076
+		if ( in_array( $args[ 'type' ], $option_types, true ) ) {
1077 1077
 
1078
-			$args['show_option_none'] = isset( $args['show_option_none'] ) ? $args['show_option_none'] : null;
1079
-			$args['show_option_none'] = true === $args['show_option_none'] ? __( 'None', 'cmb2' ) : $args['show_option_none'];
1078
+			$args[ 'show_option_none' ] = isset( $args[ 'show_option_none' ] ) ? $args[ 'show_option_none' ] : null;
1079
+			$args[ 'show_option_none' ] = true === $args[ 'show_option_none' ] ? __( 'None', 'cmb2' ) : $args[ 'show_option_none' ];
1080 1080
 
1081
-			if ( null === $args['show_option_none'] ) {
1082
-				$off_by_default = in_array( $args['type'], array( 'select', 'radio', 'radio_inline' ), true );
1083
-				$args['show_option_none'] = $off_by_default ? false : __( 'None', 'cmb2' );
1081
+			if ( null === $args[ 'show_option_none' ] ) {
1082
+				$off_by_default = in_array( $args[ 'type' ], array( 'select', 'radio', 'radio_inline' ), true );
1083
+				$args[ 'show_option_none' ] = $off_by_default ? false : __( 'None', 'cmb2' );
1084 1084
 			}
1085 1085
 
1086 1086
 		}
1087 1087
 
1088
-		$args['has_supporting_data'] = in_array(
1089
-			$args['type'],
1088
+		$args[ 'has_supporting_data' ] = in_array(
1089
+			$args[ 'type' ],
1090 1090
 			array(
1091 1091
 				// CMB2_Sanitize::_save_file_id_value()/CMB2_Sanitize::_get_group_file_value_array()
1092 1092
 				'file',
Please login to merge, or discard this patch.
includes/types/CMB2_Type_Select.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,6 +22,6 @@
 block discarded – undo
22 22
 		) );
23 23
 
24 24
 		$attrs = $this->types->concat_attrs( $a, array( 'desc', 'options' ) );
25
-		return sprintf( '<select%s>%s</select>%s', $attrs, $a['options'], $a['desc'] );
25
+		return sprintf( '<select%s>%s</select>%s', $attrs, $a[ 'options' ], $a[ 'desc' ] );
26 26
 	}
27 27
 }
Please login to merge, or discard this patch.
includes/types/CMB2_Type_Oembed.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * CMB oembed field type
4
- *
5
- * @since  2.2.2
6
- *
7
- * @category  WordPress_Plugin
8
- * @package   CMB2
9
- * @author    WebDevStudios
10
- * @license   GPL-2.0+
11
- * @link      http://webdevstudios.com
12
- */
3
+	 * CMB oembed field type
4
+	 *
5
+	 * @since  2.2.2
6
+	 *
7
+	 * @category  WordPress_Plugin
8
+	 * @package   CMB2
9
+	 * @author    WebDevStudios
10
+	 * @license   GPL-2.0+
11
+	 * @link      http://webdevstudios.com
12
+	 */
13 13
 class CMB2_Type_Oembed extends CMB2_Type_Text {
14 14
 
15 15
 	public function render() {
Please login to merge, or discard this 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" style="display:none;"></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">%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', __( '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"><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', __( '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', __( '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', __( '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.