@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * CMB text_datetime_timestamp_timezone 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 text_datetime_timestamp_timezone 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_Text_Datetime_Timestamp_Timezone extends CMB2_Type_Base { |
14 | 14 | |
15 | 15 | public function render() { |
@@ -22,12 +22,12 @@ discard block |
||
22 | 22 | 'select_timezone' => array(), |
23 | 23 | ) ); |
24 | 24 | |
25 | - $args['value'] = $field->escaped_value(); |
|
26 | - if ( is_array( $args['value'] ) ) { |
|
27 | - $args['value'] = ''; |
|
25 | + $args[ 'value' ] = $field->escaped_value(); |
|
26 | + if ( is_array( $args[ 'value' ] ) ) { |
|
27 | + $args[ 'value' ] = ''; |
|
28 | 28 | } |
29 | 29 | |
30 | - $datetime = maybe_unserialize( $args['value'] ); |
|
30 | + $datetime = maybe_unserialize( $args[ 'value' ] ); |
|
31 | 31 | $value = $tzstring = ''; |
32 | 32 | |
33 | 33 | if ( $datetime && $datetime instanceof DateTime ) { |
@@ -36,19 +36,19 @@ discard block |
||
36 | 36 | $value = $datetime->getTimestamp(); |
37 | 37 | } |
38 | 38 | |
39 | - $timestamp_args = wp_parse_args( $args['text_datetime_timestamp'], array( |
|
39 | + $timestamp_args = wp_parse_args( $args[ 'text_datetime_timestamp' ], array( |
|
40 | 40 | 'desc' => '', |
41 | 41 | 'value' => $value, |
42 | 42 | 'rendered' => true, |
43 | 43 | ) ); |
44 | 44 | $datetime_timestamp = $this->types->text_datetime_timestamp( $timestamp_args ); |
45 | 45 | |
46 | - $timezone_select_args = wp_parse_args( $args['select_timezone'], array( |
|
46 | + $timezone_select_args = wp_parse_args( $args[ 'select_timezone' ], array( |
|
47 | 47 | 'class' => 'cmb2_select cmb2-select-timezone', |
48 | 48 | 'name' => $this->_name( '[timezone]' ), |
49 | 49 | 'id' => $this->_id( '_timezone' ), |
50 | 50 | 'options' => wp_timezone_choice( $tzstring ), |
51 | - 'desc' => $args['desc'], |
|
51 | + 'desc' => $args[ 'desc' ], |
|
52 | 52 | 'rendered' => true, |
53 | 53 | ) ); |
54 | 54 | $select = $this->types->select( $timezone_select_args ); |
@@ -46,7 +46,7 @@ |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | protected function ul( $a ) { |
49 | - return sprintf( '<ul class="%s">%s</ul>%s', $a['class'], $a['options'], $a['desc'] ); |
|
49 | + return sprintf( '<ul class="%s">%s</ul>%s', $a[ 'class' ], $a[ 'options' ], $a[ 'desc' ] ); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | } |
@@ -15,7 +15,6 @@ |
||
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() { |
@@ -24,7 +24,7 @@ |
||
24 | 24 | $attrs = $this->concat_attrs( $a, array( 'desc', 'options' ) ); |
25 | 25 | |
26 | 26 | return $this->rendered( |
27 | - sprintf( '<select%s>%s</select>%s', $attrs, $a['options'], $a['desc'] ) |
|
27 | + sprintf( '<select%s>%s</select>%s', $attrs, $a[ 'options' ], $a[ 'desc' ] ) |
|
28 | 28 | ); |
29 | 29 | } |
30 | 30 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | ), $args ); |
32 | 32 | |
33 | 33 | return $this->rendered( |
34 | - sprintf( '<textarea%s>%s</textarea>%s', $this->concat_attrs( $a, array( 'desc', 'value' ) ), $a['value'], $a['desc'] ) |
|
34 | + sprintf( '<textarea%s>%s</textarea>%s', $this->concat_attrs( $a, array( 'desc', 'value' ) ), $a[ 'value' ], $a[ 'desc' ] ) |
|
35 | 35 | ); |
36 | 36 | } |
37 | 37 | } |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * CMB title 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 title 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_Title extends CMB2_Type_Base { |
14 | 14 | |
15 | 15 | public function render() { |
@@ -21,7 +21,7 @@ |
||
21 | 21 | ) ); |
22 | 22 | |
23 | 23 | return $this->rendered( |
24 | - sprintf( '<%1$s class="%2$s">%3$s</%1$s>%4$s', $a['tag'], $a['class'], $a['name'], $a['desc'] ) |
|
24 | + sprintf( '<%1$s class="%2$s">%3$s</%1$s>%4$s', $a[ 'tag' ], $a[ 'class' ], $a[ 'name' ], $a[ 'desc' ] ) |
|
25 | 25 | ); |
26 | 26 | } |
27 | 27 |
@@ -162,7 +162,7 @@ |
||
162 | 162 | * @return string String of attributes for form element |
163 | 163 | */ |
164 | 164 | public function concat_attrs( $attrs, $attr_exclude = array() ) { |
165 | - $attr_exclude[] = 'rendered'; |
|
165 | + $attr_exclude[ ] = 'rendered'; |
|
166 | 166 | $attributes = ''; |
167 | 167 | foreach ( $attrs as $attr => $val ) { |
168 | 168 | $excluded = in_array( $attr, (array) $attr_exclude, true ); |
@@ -117,16 +117,16 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function __construct( $args ) { |
119 | 119 | |
120 | - if ( ! empty( $args['group_field'] ) ) { |
|
121 | - $this->group = $args['group_field']; |
|
120 | + if ( ! empty( $args[ 'group_field' ] ) ) { |
|
121 | + $this->group = $args[ 'group_field' ]; |
|
122 | 122 | $this->object_id = $this->group->object_id; |
123 | 123 | $this->object_type = $this->group->object_type; |
124 | 124 | } else { |
125 | - $this->object_id = isset( $args['object_id'] ) && '_' !== $args['object_id'] ? $args['object_id'] : 0; |
|
126 | - $this->object_type = isset( $args['object_type'] ) ? $args['object_type'] : 'post'; |
|
125 | + $this->object_id = isset( $args[ 'object_id' ] ) && '_' !== $args[ 'object_id' ] ? $args[ 'object_id' ] : 0; |
|
126 | + $this->object_type = isset( $args[ 'object_type' ] ) ? $args[ 'object_type' ] : 'post'; |
|
127 | 127 | } |
128 | 128 | |
129 | - $this->args = $this->_set_field_defaults( $args['field_args'] ); |
|
129 | + $this->args = $this->_set_field_defaults( $args[ 'field_args' ] ); |
|
130 | 130 | |
131 | 131 | if ( $this->object_id ) { |
132 | 132 | $this->value = $this->get_data(); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | * @return mixed Value of field argument |
142 | 142 | */ |
143 | 143 | public function __call( $name, $arguments ) { |
144 | - $key = isset( $arguments[0] ) ? $arguments[0] : false; |
|
144 | + $key = isset( $arguments[ 0 ] ) ? $arguments[ 0 ] : false; |
|
145 | 145 | return $this->args( $name, $key ); |
146 | 146 | } |
147 | 147 | |
@@ -212,9 +212,9 @@ discard block |
||
212 | 212 | */ |
213 | 213 | public function get_data( $field_id = '', $args = array() ) { |
214 | 214 | if ( $field_id ) { |
215 | - $args['field_id'] = $field_id; |
|
215 | + $args[ 'field_id' ] = $field_id; |
|
216 | 216 | } else if ( $this->group ) { |
217 | - $args['field_id'] = $this->group->id(); |
|
217 | + $args[ 'field_id' ] = $this->group->id(); |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | $a = $this->data_args( $args ); |
@@ -255,13 +255,13 @@ discard block |
||
255 | 255 | * |
256 | 256 | * @since 2.0.0 |
257 | 257 | */ |
258 | - $data = apply_filters( "cmb2_override_{$a['field_id']}_meta_value", $data, $this->object_id, $a, $this ); |
|
258 | + $data = apply_filters( "cmb2_override_{$a[ 'field_id' ]}_meta_value", $data, $this->object_id, $a, $this ); |
|
259 | 259 | |
260 | 260 | // If no override, get value normally |
261 | 261 | if ( 'cmb2_field_no_override_val' === $data ) { |
262 | - $data = 'options-page' === $a['type'] |
|
263 | - ? cmb2_options( $a['id'] )->get( $a['field_id'] ) |
|
264 | - : get_metadata( $a['type'], $a['id'], $a['field_id'], ( $a['single'] || $a['repeat'] ) ); |
|
262 | + $data = 'options-page' === $a[ 'type' ] |
|
263 | + ? cmb2_options( $a[ 'id' ] )->get( $a[ 'field_id' ] ) |
|
264 | + : get_metadata( $a[ 'type' ], $a[ 'id' ], $a[ 'field_id' ], ( $a[ 'single' ] || $a[ 'repeat' ] ) ); |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | if ( $this->group ) { |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | public function update_data( $new_value, $single = true ) { |
284 | 284 | $a = $this->data_args( array( 'single' => $single ) ); |
285 | 285 | |
286 | - $a['value'] = $a['repeat'] ? array_values( $new_value ) : $new_value; |
|
286 | + $a[ 'value' ] = $a[ 'repeat' ] ? array_values( $new_value ) : $new_value; |
|
287 | 287 | |
288 | 288 | /** |
289 | 289 | * Filter whether to override saving of meta value. |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | * |
320 | 320 | * @since 2.0.0 |
321 | 321 | */ |
322 | - $override = apply_filters( "cmb2_override_{$a['field_id']}_meta_save", $override, $a, $this->args(), $this ); |
|
322 | + $override = apply_filters( "cmb2_override_{$a[ 'field_id' ]}_meta_save", $override, $a, $this->args(), $this ); |
|
323 | 323 | |
324 | 324 | // If override, return that |
325 | 325 | if ( null !== $override ) { |
@@ -327,22 +327,22 @@ discard block |
||
327 | 327 | } |
328 | 328 | |
329 | 329 | // Options page handling (or temp data store) |
330 | - if ( 'options-page' === $a['type'] || empty( $a['id'] ) ) { |
|
331 | - return cmb2_options( $a['id'] )->update( $a['field_id'], $a['value'], false, $a['single'] ); |
|
330 | + if ( 'options-page' === $a[ 'type' ] || empty( $a[ 'id' ] ) ) { |
|
331 | + return cmb2_options( $a[ 'id' ] )->update( $a[ 'field_id' ], $a[ 'value' ], false, $a[ 'single' ] ); |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | // Add metadata if not single |
335 | - if ( ! $a['single'] ) { |
|
336 | - return add_metadata( $a['type'], $a['id'], $a['field_id'], $a['value'], false ); |
|
335 | + if ( ! $a[ 'single' ] ) { |
|
336 | + return add_metadata( $a[ 'type' ], $a[ 'id' ], $a[ 'field_id' ], $a[ 'value' ], false ); |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | // Delete meta if we have an empty array |
340 | - if ( is_array( $a['value'] ) && empty( $a['value'] ) ) { |
|
341 | - return delete_metadata( $a['type'], $a['id'], $a['field_id'], $this->value ); |
|
340 | + if ( is_array( $a[ 'value' ] ) && empty( $a[ 'value' ] ) ) { |
|
341 | + return delete_metadata( $a[ 'type' ], $a[ 'id' ], $a[ 'field_id' ], $this->value ); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | // Update metadata |
345 | - return update_metadata( $a['type'], $a['id'], $a['field_id'], $a['value'] ); |
|
345 | + return update_metadata( $a[ 'type' ], $a[ 'id' ], $a[ 'field_id' ], $a[ 'value' ] ); |
|
346 | 346 | } |
347 | 347 | |
348 | 348 | /** |
@@ -392,19 +392,19 @@ discard block |
||
392 | 392 | * @param array $field_args All field arguments |
393 | 393 | * @param CMB2_Field object $field This field object |
394 | 394 | */ |
395 | - $override = apply_filters( "cmb2_override_{$a['field_id']}_meta_remove", $override, $a, $this->args(), $this ); |
|
395 | + $override = apply_filters( "cmb2_override_{$a[ 'field_id' ]}_meta_remove", $override, $a, $this->args(), $this ); |
|
396 | 396 | |
397 | 397 | // If no override, remove as usual |
398 | 398 | if ( null !== $override ) { |
399 | 399 | return $override; |
400 | 400 | } |
401 | 401 | // Option page handling |
402 | - elseif ( 'options-page' === $a['type'] || empty( $a['id'] ) ) { |
|
403 | - return cmb2_options( $a['id'] )->remove( $a['field_id'] ); |
|
402 | + elseif ( 'options-page' === $a[ 'type' ] || empty( $a[ 'id' ] ) ) { |
|
403 | + return cmb2_options( $a[ 'id' ] )->remove( $a[ 'field_id' ] ); |
|
404 | 404 | } |
405 | 405 | |
406 | 406 | // Remove metadata |
407 | - return delete_metadata( $a['type'], $a['id'], $a['field_id'], $old ); |
|
407 | + return delete_metadata( $a[ 'type' ], $a[ 'id' ], $a[ 'field_id' ], $old ); |
|
408 | 408 | } |
409 | 409 | |
410 | 410 | /** |
@@ -876,7 +876,7 @@ discard block |
||
876 | 876 | |
877 | 877 | foreach ( $conditional_classes as $class => $condition ) { |
878 | 878 | if ( $condition ) { |
879 | - $classes[] = $class; |
|
879 | + $classes[ ] = $class; |
|
880 | 880 | } |
881 | 881 | } |
882 | 882 | |
@@ -885,7 +885,7 @@ discard block |
||
885 | 885 | } |
886 | 886 | |
887 | 887 | if ( $added_classes ) { |
888 | - $classes[] = esc_attr( $added_classes ); |
|
888 | + $classes[ ] = esc_attr( $added_classes ); |
|
889 | 889 | } |
890 | 890 | |
891 | 891 | /** |
@@ -990,10 +990,10 @@ discard block |
||
990 | 990 | return $this->field_options; |
991 | 991 | } |
992 | 992 | |
993 | - $this->field_options = (array) $this->args['options']; |
|
993 | + $this->field_options = (array) $this->args[ 'options' ]; |
|
994 | 994 | |
995 | - if ( is_callable( $this->args['options_cb'] ) ) { |
|
996 | - $options = call_user_func( $this->args['options_cb'], $this ); |
|
995 | + if ( is_callable( $this->args[ 'options_cb' ] ) ) { |
|
996 | + $options = call_user_func( $this->args[ 'options_cb' ], $this ); |
|
997 | 997 | |
998 | 998 | if ( $options && is_array( $options ) ) { |
999 | 999 | $this->field_options += $options; |
@@ -1014,7 +1014,7 @@ discard block |
||
1014 | 1014 | */ |
1015 | 1015 | public function add_js_dependencies( $dependencies = array() ) { |
1016 | 1016 | foreach ( (array) $dependencies as $dependency ) { |
1017 | - $this->args['js_dependencies'][ $dependency ] = $dependency; |
|
1017 | + $this->args[ 'js_dependencies' ][ $dependency ] = $dependency; |
|
1018 | 1018 | } |
1019 | 1019 | |
1020 | 1020 | CMB2_JS::add_dependencies( $dependencies ); |
@@ -1028,17 +1028,17 @@ discard block |
||
1028 | 1028 | * @return mixed Default field value |
1029 | 1029 | */ |
1030 | 1030 | public function get_default() { |
1031 | - if ( null !== $this->args['default'] ) { |
|
1032 | - return $this->args['default']; |
|
1031 | + if ( null !== $this->args[ 'default' ] ) { |
|
1032 | + return $this->args[ 'default' ]; |
|
1033 | 1033 | } |
1034 | 1034 | |
1035 | - $param = is_callable( $this->args['default_cb'] ) ? 'default_cb' : 'default'; |
|
1035 | + $param = is_callable( $this->args[ 'default_cb' ] ) ? 'default_cb' : 'default'; |
|
1036 | 1036 | $default = $this->get_param_callback_result( $param, false ); |
1037 | 1037 | |
1038 | 1038 | // Allow a filter override of the default value |
1039 | - $this->args['default'] = apply_filters( 'cmb2_default_filter', $default, $this ); |
|
1039 | + $this->args[ 'default' ] = apply_filters( 'cmb2_default_filter', $default, $this ); |
|
1040 | 1040 | |
1041 | - return $this->args['default']; |
|
1041 | + return $this->args[ 'default' ]; |
|
1042 | 1042 | } |
1043 | 1043 | |
1044 | 1044 | /** |
@@ -1063,70 +1063,70 @@ discard block |
||
1063 | 1063 | 'default_cb' => '', |
1064 | 1064 | 'select_all_button' => true, |
1065 | 1065 | 'multiple' => false, |
1066 | - 'repeatable' => isset( $args['type'] ) && 'group' == $args['type'], |
|
1066 | + 'repeatable' => isset( $args[ 'type' ] ) && 'group' == $args[ 'type' ], |
|
1067 | 1067 | 'inline' => false, |
1068 | 1068 | 'on_front' => true, |
1069 | 1069 | 'show_names' => true, |
1070 | 1070 | 'date_format' => 'm\/d\/Y', |
1071 | 1071 | 'time_format' => 'h:i A', |
1072 | - 'description' => isset( $args['desc'] ) ? $args['desc'] : '', |
|
1073 | - 'preview_size' => 'file' == $args['type'] ? array( 350, 350 ) : array( 50, 50 ), |
|
1072 | + 'description' => isset( $args[ 'desc' ] ) ? $args[ 'desc' ] : '', |
|
1073 | + 'preview_size' => 'file' == $args[ 'type' ] ? array( 350, 350 ) : array( 50, 50 ), |
|
1074 | 1074 | 'render_row_cb' => array( $this, 'render_field_callback' ), |
1075 | - 'label_cb' => 'title' != $args['type'] ? array( $this, 'label' ) : '', |
|
1075 | + 'label_cb' => 'title' != $args[ 'type' ] ? array( $this, 'label' ) : '', |
|
1076 | 1076 | 'show_in_rest' => null, |
1077 | 1077 | 'js_dependencies' => array(), |
1078 | 1078 | ) ); |
1079 | 1079 | |
1080 | 1080 | // default param can be passed a callback as well |
1081 | - if ( is_callable( $args['default'] ) ) { |
|
1082 | - $args['default_cb'] = $args['default']; |
|
1083 | - $args['default'] = null; |
|
1081 | + if ( is_callable( $args[ 'default' ] ) ) { |
|
1082 | + $args[ 'default_cb' ] = $args[ 'default' ]; |
|
1083 | + $args[ 'default' ] = null; |
|
1084 | 1084 | } |
1085 | 1085 | |
1086 | - $args['repeatable'] = $args['repeatable'] && ! $this->repeatable_exception( $args['type'] ); |
|
1087 | - $args['inline'] = $args['inline'] || false !== stripos( $args['type'], '_inline' ); |
|
1086 | + $args[ 'repeatable' ] = $args[ 'repeatable' ] && ! $this->repeatable_exception( $args[ 'type' ] ); |
|
1087 | + $args[ 'inline' ] = $args[ 'inline' ] || false !== stripos( $args[ 'type' ], '_inline' ); |
|
1088 | 1088 | |
1089 | 1089 | // options param can be passed a callback as well |
1090 | - if ( is_callable( $args['options'] ) ) { |
|
1091 | - $args['options_cb'] = $args['options']; |
|
1092 | - $args['options'] = array(); |
|
1090 | + if ( is_callable( $args[ 'options' ] ) ) { |
|
1091 | + $args[ 'options_cb' ] = $args[ 'options' ]; |
|
1092 | + $args[ 'options' ] = array(); |
|
1093 | 1093 | } |
1094 | 1094 | |
1095 | - $args['options'] = 'group' == $args['type'] ? wp_parse_args( $args['options'], array( |
|
1095 | + $args[ 'options' ] = 'group' == $args[ 'type' ] ? wp_parse_args( $args[ 'options' ], array( |
|
1096 | 1096 | 'add_button' => __( 'Add Group', 'cmb2' ), |
1097 | 1097 | 'remove_button' => __( 'Remove Group', 'cmb2' ), |
1098 | - ) ) : $args['options']; |
|
1098 | + ) ) : $args[ 'options' ]; |
|
1099 | 1099 | |
1100 | - $args['_id'] = $args['id']; |
|
1101 | - $args['_name'] = $args['id']; |
|
1100 | + $args[ '_id' ] = $args[ 'id' ]; |
|
1101 | + $args[ '_name' ] = $args[ 'id' ]; |
|
1102 | 1102 | |
1103 | 1103 | if ( $this->group ) { |
1104 | 1104 | |
1105 | - $args['id'] = $this->group->args( 'id' ) . '_' . $this->group->index . '_' . $args['id']; |
|
1106 | - $args['_name'] = $this->group->args( 'id' ) . '[' . $this->group->index . '][' . $args['_name'] . ']'; |
|
1105 | + $args[ 'id' ] = $this->group->args( 'id' ) . '_' . $this->group->index . '_' . $args[ 'id' ]; |
|
1106 | + $args[ '_name' ] = $this->group->args( 'id' ) . '[' . $this->group->index . '][' . $args[ '_name' ] . ']'; |
|
1107 | 1107 | } |
1108 | 1108 | |
1109 | - if ( 'wysiwyg' == $args['type'] ) { |
|
1110 | - $args['id'] = strtolower( str_ireplace( '-', '_', $args['id'] ) ); |
|
1111 | - $args['options']['textarea_name'] = $args['_name']; |
|
1109 | + if ( 'wysiwyg' == $args[ 'type' ] ) { |
|
1110 | + $args[ 'id' ] = strtolower( str_ireplace( '-', '_', $args[ 'id' ] ) ); |
|
1111 | + $args[ 'options' ][ 'textarea_name' ] = $args[ '_name' ]; |
|
1112 | 1112 | } |
1113 | 1113 | |
1114 | 1114 | $option_types = apply_filters( 'cmb2_all_or_nothing_types', array( 'select', 'radio', 'radio_inline', 'taxonomy_select', 'taxonomy_radio', 'taxonomy_radio_inline' ), $this ); |
1115 | 1115 | |
1116 | - if ( in_array( $args['type'], $option_types, true ) ) { |
|
1116 | + if ( in_array( $args[ 'type' ], $option_types, true ) ) { |
|
1117 | 1117 | |
1118 | - $args['show_option_none'] = isset( $args['show_option_none'] ) ? $args['show_option_none'] : null; |
|
1119 | - $args['show_option_none'] = true === $args['show_option_none'] ? __( 'None', 'cmb2' ) : $args['show_option_none']; |
|
1118 | + $args[ 'show_option_none' ] = isset( $args[ 'show_option_none' ] ) ? $args[ 'show_option_none' ] : null; |
|
1119 | + $args[ 'show_option_none' ] = true === $args[ 'show_option_none' ] ? __( 'None', 'cmb2' ) : $args[ 'show_option_none' ]; |
|
1120 | 1120 | |
1121 | - if ( null === $args['show_option_none'] ) { |
|
1122 | - $off_by_default = in_array( $args['type'], array( 'select', 'radio', 'radio_inline' ), true ); |
|
1123 | - $args['show_option_none'] = $off_by_default ? false : __( 'None', 'cmb2' ); |
|
1121 | + if ( null === $args[ 'show_option_none' ] ) { |
|
1122 | + $off_by_default = in_array( $args[ 'type' ], array( 'select', 'radio', 'radio_inline' ), true ); |
|
1123 | + $args[ 'show_option_none' ] = $off_by_default ? false : __( 'None', 'cmb2' ); |
|
1124 | 1124 | } |
1125 | 1125 | |
1126 | 1126 | } |
1127 | 1127 | |
1128 | - $args['has_supporting_data'] = in_array( |
|
1129 | - $args['type'], |
|
1128 | + $args[ 'has_supporting_data' ] = in_array( |
|
1129 | + $args[ 'type' ], |
|
1130 | 1130 | array( |
1131 | 1131 | // CMB2_Sanitize::_save_file_id_value()/CMB2_Sanitize::_get_group_file_value_array() |
1132 | 1132 | 'file', |
@@ -50,12 +50,12 @@ |
||
50 | 50 | 'js_dependencies' => array(), |
51 | 51 | ), $args ); |
52 | 52 | |
53 | - if ( ! empty( $a['js_dependencies'] ) ) { |
|
54 | - $this->field->add_js_dependencies( $a['js_dependencies'] ); |
|
53 | + if ( ! empty( $a[ 'js_dependencies' ] ) ) { |
|
54 | + $this->field->add_js_dependencies( $a[ 'js_dependencies' ] ); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | return $this->rendered( |
58 | - sprintf( '<input%s/>%s', $this->concat_attrs( $a, array( 'desc', 'js_dependencies' ) ), $a['desc'] ) |
|
58 | + sprintf( '<input%s/>%s', $this->concat_attrs( $a, array( 'desc', 'js_dependencies' ) ), $a[ 'desc' ] ) |
|
59 | 59 | ); |
60 | 60 | } |
61 | 61 | } |