Completed
Pull Request — trunk (#848)
by
unknown
06:06
created
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.