@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * CMB select_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 select_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_Select_Timezone extends CMB2_Type_Select { |
14 | 14 | |
15 | 15 | public function render() { |
@@ -14,7 +14,7 @@ |
||
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 |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * CMB Taxonomy base 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 base 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 | abstract class CMB2_Type_Taxonomy_Base extends CMB2_Type_Multi_Base { |
14 | 14 | |
15 | 15 | /** |
@@ -50,10 +50,10 @@ |
||
50 | 50 | 'js_dependencies' => array(), |
51 | 51 | ), $args ); |
52 | 52 | |
53 | - if ( ! empty( $a['js_dependencies'] ) ) { |
|
54 | - CMB2_JS::add_dependencies( $a['js_dependencies'] ); |
|
53 | + if ( ! empty( $a[ 'js_dependencies' ] ) ) { |
|
54 | + CMB2_JS::add_dependencies( $a[ 'js_dependencies' ] ); |
|
55 | 55 | } |
56 | 56 | |
57 | - return sprintf( '<input%s/>%s', $this->concat_attrs( $a, array( 'desc', 'js_dependencies' ) ), $a['desc'] ); |
|
57 | + return sprintf( '<input%s/>%s', $this->concat_attrs( $a, array( 'desc', 'js_dependencies' ) ), $a[ 'desc' ] ); |
|
58 | 58 | } |
59 | 59 | } |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * CMB taxonomy_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 taxonomy_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_Taxonomy_Multicheck extends CMB2_Type_Taxonomy_Base { |
14 | 14 | |
15 | 15 | public function render() { |
@@ -36,7 +36,7 @@ |
||
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->types->list_input( $args, $i ); |
42 | 42 | $i++; |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * CMB Multi base 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 Multi base 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 | abstract class CMB2_Type_Multi_Base extends CMB2_Type_Base { |
14 | 14 | |
15 | 15 | /** |
@@ -19,7 +19,7 @@ discard block |
||
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 |
||
39 | 39 | 'label' => '', |
40 | 40 | ), $args ); |
41 | 41 | |
42 | - return sprintf( "\t" . '<li><input%s/> <label for="%s">%s</label></li>' . "\n", $this->types->concat_attrs( $a, array( 'label' ) ), $a['id'], $a['label'] ); |
|
42 | + return sprintf( "\t" . '<li><input%s/> <label for="%s">%s</label></li>' . "\n", $this->types->concat_attrs( $a, array( 'label' ) ), $a[ 'id' ], $a[ 'label' ] ); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -51,10 +51,10 @@ discard block |
||
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 |
||
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 = $field->escaped_value() |
74 | 74 | ? $field->escaped_value() |
@@ -86,12 +86,12 @@ discard block |
||
86 | 86 | // Clone args & modify for just this item |
87 | 87 | $a = $args; |
88 | 88 | |
89 | - $a['value'] = $opt_value; |
|
90 | - $a['label'] = $opt_label; |
|
89 | + $a[ 'value' ] = $opt_value; |
|
90 | + $a[ 'label' ] = $opt_label; |
|
91 | 91 | |
92 | 92 | // Check if this option is the value of the input |
93 | 93 | if ( $value == $opt_value ) { |
94 | - $a['checked'] = 'checked'; |
|
94 | + $a[ 'checked' ] = 'checked'; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | $concatenated_items .= $this->$method( $a, $i++ ); |
@@ -16,7 +16,7 @@ discard block |
||
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 | $i = 1; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | if ( ! $terms ) { |
25 | 25 | $options .= sprintf( '<li><label>%s</label></li>', esc_html( $this->types->_text( 'no_terms_text', __( '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 |
||
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 |
||
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++; |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * CMB colorpicker 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 colorpicker 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_Colorpicker extends CMB2_Type_Text { |
14 | 14 | |
15 | 15 | /** |
@@ -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 |
@@ -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(); |