@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $output = ''; |
22 | 22 | |
23 | 23 | // if options array and 'url' => false, then hide the url field |
24 | - $input_type = array_key_exists( 'url', $options ) && false === $options['url'] ? 'hidden' : 'text'; |
|
24 | + $input_type = array_key_exists( 'url', $options ) && false === $options[ 'url' ] ? 'hidden' : 'text'; |
|
25 | 25 | |
26 | 26 | $output .= parent::render( array( |
27 | 27 | 'type' => $input_type, |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | // Reset field args for attachment ID |
43 | 43 | $args = $field->args(); |
44 | 44 | // If we're looking at a file in a group, we need to get the non-prefixed id |
45 | - $args['id'] = ( $field->group ? $field->args( '_id' ) : $cached_id ) . '_id'; |
|
46 | - unset( $args['_id'], $args['_name'] ); |
|
45 | + $args[ 'id' ] = ( $field->group ? $field->args( '_id' ) : $cached_id ) . '_id'; |
|
46 | + unset( $args[ '_id' ], $args[ '_name' ] ); |
|
47 | 47 | |
48 | 48 | // And get new field object |
49 | 49 | $this->types->field = $field = new CMB2_Field( array( |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | if ( $_id_value ) { |
76 | 76 | $image = wp_get_attachment_image( $_id_value, $img_size, null, array( 'class' => 'cmb-file-field-image' ) ); |
77 | 77 | } else { |
78 | - $size = is_array( $img_size ) ? $img_size[0] : 350; |
|
78 | + $size = is_array( $img_size ) ? $img_size[ 0 ] : 350; |
|
79 | 79 | $image = '<img style="max-width: ' . absint( $size ) . 'px; width: 100%; height: auto;" src="' . $meta_value . '" alt="" />'; |
80 | 80 | } |
81 | 81 |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * CMB file 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 file 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_File extends CMB2_Type_File_Base { |
14 | 14 | |
15 | 15 | public function render() { |
@@ -16,11 +16,11 @@ |
||
16 | 16 | $field = $this->field; |
17 | 17 | $names = $this->get_object_terms(); |
18 | 18 | |
19 | - $saved_term = is_wp_error( $names ) || empty( $names ) ? $field->get_default() : $names[key( $names )]->slug; |
|
19 | + $saved_term = is_wp_error( $names ) || empty( $names ) ? $field->get_default() : $names[ key( $names ) ]->slug; |
|
20 | 20 | $terms = get_terms( $field->args( 'taxonomy' ), 'hide_empty=0' ); |
21 | 21 | $options = ''; |
22 | 22 | |
23 | - $option_none = $field->args( 'show_option_none' ); |
|
23 | + $option_none = $field->args( 'show_option_none' ); |
|
24 | 24 | if ( ! empty( $option_none ) ) { |
25 | 25 | |
26 | 26 | $field_id = $this->_id(); |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * CMB taxonomy_select 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 taxonomy_select 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_Taxonomy_Select extends CMB2_Type_Taxonomy_Base { |
14 | 14 | |
15 | 15 | public function render() { |
@@ -47,7 +47,7 @@ |
||
47 | 47 | : $this->is_checked; |
48 | 48 | |
49 | 49 | if ( $is_checked ) { |
50 | - $defaults['checked'] = 'checked'; |
|
50 | + $defaults[ 'checked' ] = 'checked'; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | $args = $this->parse_args( 'checkbox', $defaults ); |
@@ -20,7 +20,7 @@ |
||
20 | 20 | 'js_dependencies' => array( 'jquery-ui-core', 'jquery-ui-datepicker' ), |
21 | 21 | ) ); |
22 | 22 | |
23 | - if ( false === strpos( $args['class'], 'timepicker' ) ) { |
|
23 | + if ( false === strpos( $args[ 'class' ], 'timepicker' ) ) { |
|
24 | 24 | $this->parse_picker_options( 'date' ); |
25 | 25 | } |
26 | 26 |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | if ( $update ) { |
31 | 31 | $atts = $this->field->args( 'attributes' ); |
32 | 32 | } else { |
33 | - $atts = isset( $args['attributes'] ) |
|
34 | - ? $args['attributes'] |
|
33 | + $atts = isset( $args[ 'attributes' ] ) |
|
34 | + ? $args[ 'attributes' ] |
|
35 | 35 | : $atts; |
36 | 36 | } |
37 | 37 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | if ( $update ) { |
50 | - $this->field->args['attributes'] = $atts; |
|
50 | + $this->field->args[ 'attributes' ] = $atts; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | return array_merge( $args, $atts ); |
@@ -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 | } |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * CMB multicheck 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 multicheck 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_Multicheck extends CMB2_Type_Radio { |
14 | 14 | |
15 | 15 | /** |